From muktavasudeva@hfcl.com Thu Jan 29 13:03:38 2004 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id B2893D1C98E for ; Thu, 29 Jan 2004 13:03:38 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 12229-08 for ; Thu, 29 Jan 2004 09:03:16 -0400 (AST) Received: from mx.primus-india.net (unknown [203.196.128.60]) by svr1.postgresql.org (Postfix) with ESMTP id BABC0D1CAD9 for ; Thu, 29 Jan 2004 09:03:05 -0400 (AST) Received: from mukta (cfsl-73-129-del.cofuture.com [203.196.129.73] (may be forged)) by mx.primus-india.net (8.12.8/8.12.8) with SMTP id i0TDON8Y009145 for ; Thu, 29 Jan 2004 18:54:23 +0530 Message-ID: <00a801c3e669$004f08c0$ea08a8c0@mukta> From: "MUKTA" To: Subject: Date: Thu, 29 Jan 2004 18:38:33 +0530 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_00A5_01C3E697.1912AB90" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.6 tagged_above=0.0 required=5.0 tests=HTML_30_40 X-Spam-Level: X-Archive-Number: 200401/254 X-Sequence-Number: 16647 This is a multi-part message in MIME format. ------=_NextPart_000_00A5_01C3E697.1912AB90 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi I have an urgent problem I want to insert values into a table using the C syscalls provided by the l= ibpq library, but i find that i can not insert into the table when i use va= riables instead of values...like so: int a,b,c,d; using the C function=20 =20 res=3DPQexecute(Conn,"INSERT into table values(a,b,c,d));.... executing above statement with plain integers does fine and inserts them in= to table.. Is there some special way to insert variables rather than plain values? do = i have to build functions (in sql) or somehting?help! Thanx ------=_NextPart_000_00A5_01C3E697.1912AB90 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi I have an urgent problem
I want to insert values into a table using= the C=20 syscalls provided by the libpq library, but i find that i can not insert in= to=20 the table when i use variables instead of values...like so:
int a,b,c,d;
using the C function
 
res=3DPQexecute(Conn,"INSERT into table=20 values(a,b,c,d));....
 
executing above statement with plain integers does fine and inserts th= em=20 into table..
 
Is there some special way to insert variab= les=20 rather than plain values? do i have to build functions (in sql) or=20 somehting?help!
Thanx
------=_NextPart_000_00A5_01C3E697.1912AB90-- From bc@vio.ro Thu Jan 29 13:09:58 2004 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 6995DD1B8D4 for ; Thu, 29 Jan 2004 13:09:58 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 15156-09 for ; Thu, 29 Jan 2004 09:09:33 -0400 (AST) Received: from mail1.dr.myx.net (mail1.dr.myx.net [217.10.193.161]) by svr1.postgresql.org (Postfix) with ESMTP id 10A44D1D223 for ; Thu, 29 Jan 2004 09:09:19 -0400 (AST) Received: from appserver (unknown [82.137.2.202]) by mail1.dr.myx.net (mydomain.myx.net) with ESMTP id 40C3A300996; Thu, 29 Jan 2004 15:09:26 +0200 (EET) Message-ID: <031501c3e669$71b30ca0$6500a8c0@wylog.local> From: "Viorel Dragomir" To: "MUKTA" , References: <00a801c3e669$004f08c0$ea08a8c0@mukta> Subject: Re: Date: Thu, 29 Jan 2004 15:11:44 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0312_01C3E67A.34BD84E0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.7 tagged_above=0.0 required=5.0 tests=HTML_40_50, REFERENCES X-Spam-Level: X-Archive-Number: 200401/255 X-Sequence-Number: 16648 This is a multi-part message in MIME format. ------=_NextPart_000_0312_01C3E67A.34BD84E0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable So, you are an artist. Isn't it? :) Your query is actually a string. This is your string: INSERT into table values(a,b,c,d) You must change your string to actually use values of tha a, b... You can make this string with sprintf sprintf(string, "INSERT into table values(%d,%d,%d,%d)", a, b, c, d); Then you launch: res=3DPQexecute(Conn, string); Why don't you use PHP? Is easier. Have a nice day ----- Original Message -----=20 From: MUKTA=20 To: pgsql-sql@postgresql.org=20 Sent: Thursday, January 29, 2004 15:08 Subject: [SQL]=20 Hi I have an urgent problem I want to insert values into a table using the C syscalls provided by the= libpq library, but i find that i can not insert into the table when i use = variables instead of values...like so: int a,b,c,d; using the C function=20 res=3DPQexecute(Conn,"INSERT into table values(a,b,c,d));.... executing above statement with plain integers does fine and inserts them = into table.. Is there some special way to insert variables rather than plain values? d= o i have to build functions (in sql) or somehting?help! Thanx ------=_NextPart_000_0312_01C3E67A.34BD84E0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
So, you are an artist. Isn't it? :)=
Your query is actually a string.
This is your string: INSERT into table values(a,b,c,d)
 
You must change your string to actually us= e values=20 of tha a, b...
You can make this string with sprintf
sprintf(string, "INSERT into table=20 values(%d,%d,%d,%d)", a, b, c, d);
 
Then you launch:
res=3DPQexecute(Conn, string);
 
Why don't you use PHP? Is easier.
 
Have a nice day
----- Original Message -----
Fro= m:=20 = MUKTA=20
To: pgsql-sql@postgresql.org
Sent: Thursday, January 29, 2004= =20 15:08
Subject: [SQL]

Hi I have an urgent problem
I want to insert values into a table usi= ng the C=20 syscalls provided by the libpq library, but i find that i can not insert = into=20 the table when i use variables instead of values...like so:
int a,b,c,d;
using the C function
 
res=3DPQexecute(Conn,"INSERT into table= =20 values(a,b,c,d));....
 
executing above statement with plain integers does fine and inserts = them=20 into table..
 
Is there some special way to insert vari= ables=20 rather than plain values? do i have to build functions (in sql) or=20 somehting?help!
Thanx
------=_NextPart_000_0312_01C3E67A.34BD84E0-- From muktavasudeva@hfcl.com Thu Jan 29 14:10:48 2004 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id A816DD1CB56 for ; Thu, 29 Jan 2004 14:10:48 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 42305-03 for ; Thu, 29 Jan 2004 10:10:25 -0400 (AST) Received: from mx.primus-india.net (mx.primus-india.net [203.196.128.60]) by svr1.postgresql.org (Postfix) with ESMTP id 81290D1C9DB for ; Thu, 29 Jan 2004 10:10:14 -0400 (AST) Received: from mukta (cfsl-73-129-del.cofuture.com [203.196.129.73] (may be forged)) by mx.primus-india.net (8.12.8/8.12.8) with SMTP id i0TEVP8Y010497; Thu, 29 Jan 2004 20:01:27 +0530 Message-ID: <00f301c3e672$5dbf1550$ea08a8c0@mukta> From: "MUKTA" To: "Viorel Dragomir" , References: <00a801c3e669$004f08c0$ea08a8c0@mukta> <031501c3e669$71b30ca0$6500a8c0@wylog.local> Subject: Re: Date: Thu, 29 Jan 2004 19:45:34 +0530 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_00F0_01C3E6A0.75B61950" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.7 tagged_above=0.0 required=5.0 tests=HTML_40_50, REFERENCES X-Spam-Level: X-Archive-Number: 200401/260 X-Sequence-Number: 16653 This is a multi-part message in MIME format. ------=_NextPart_000_00F0_01C3E6A0.75B61950 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi!! wow, ur help was extremely helpfull! thanx a bunch! i just joined this pgs= ql project 2 days ago so i dunno bout php etc, i guess i wont need to use t= he ecpg stuff for now.. Thanx a lot! Bye PS: how did u know i was an artist! :) ----- Original Message -----=20 From: Viorel Dragomir=20 To: MUKTA ; pgsql-sql@postgresql.org=20 Sent: Thursday, January 29, 2004 6:41 PM Subject: Re: [SQL]=20 So, you are an artist. Isn't it? :) Your query is actually a string. This is your string: INSERT into table values(a,b,c,d) =20=20=20 You must change your string to actually use values of tha a, b... You can make this string with sprintf sprintf(string, "INSERT into table values(%d,%d,%d,%d)", a, b, c, d); =20=20=20 Then you launch: res=3DPQexecute(Conn, string); =20=20=20 Why don't you use PHP? Is easier. =20=20=20 Have a nice day ----- Original Message -----=20 From: MUKTA=20 To: pgsql-sql@postgresql.org=20 Sent: Thursday, January 29, 2004 15:08 Subject: [SQL]=20 Hi I have an urgent problem I want to insert values into a table using the C syscalls provided by t= he libpq library, but i find that i can not insert into the table when i us= e variables instead of values...like so: int a,b,c,d; using the C function=20 =20=20=20=20=20 res=3DPQexecute(Conn,"INSERT into table values(a,b,c,d));.... executing above statement with plain integers does fine and inserts the= m into table.. Is there some special way to insert variables rather than plain values?= do i have to build functions (in sql) or somehting?help! Thanx ------=_NextPart_000_00F0_01C3E6A0.75B61950 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi!!
 wow, ur help was extremely helpfull!= thanx a=20 bunch! i just joined this pgsql project 2 days ago so i dunno bout php etc,= i=20 guess i wont need to use the ecpg stuff for now..
Thanx a lot!
Bye
PS: how did u know i was an artist! :)
----- Original Message -----
Fro= m:=20 Viorel Dragomir
To: MUK= TA ;=20 pgsql-sql@postgresql.org
Sent: Thursday, January 29, 2004 6= :41=20 PM
Subject: Re: [SQL]

So, you are an artist. Isn't it? :)
Your query is actually a string.<= /DIV>
This is your string: INSERT into table values(a,b,c,d)
 
You must change your string to actually = use=20 values of tha a, b...
You can make this string with=20 sprintf
sprintf(string, "INSERT into table=20 values(%d,%d,%d,%d)", a, b, c, d);
 
Then you launch:
res=3DPQexecute(Conn, string);
 
Why don't you use PHP? Is easier.=
 
Have a nice day
----- Original Message -----
F= rom:=20 MUKTA
To: pgsql-sql@postgresql.org
Sent: Thursday, January 29, 2004= =20 15:08
Subject: [SQL]

Hi I have an urgent problem
I want to insert values into a table u= sing the=20 C syscalls provided by the libpq library, but i find that i can not ins= ert=20 into the table when i use variables instead of values...like=20 so:
int a,b,c,d;
using the C function
 
res=3DPQexecute(Conn,"INSERT into tabl= e=20 values(a,b,c,d));....
 
executing above statement with plain integers does fine and insert= s=20 them into table..
 
Is there some special way to insert va= riables=20 rather than plain values? do i have to build functions (in sql) or=20 somehting?help!
Thanx
------=_NextPart_000_00F0_01C3E6A0.75B61950-- From chris@travelamericas.com Fri Jan 30 03:06:38 2004 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 9F4C1D1CA5E for ; Fri, 30 Jan 2004 03:06:38 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 27842-08 for ; Thu, 29 Jan 2004 23:06:11 -0400 (AST) Received: from noon.pghoster.com (noon.pghoster.com [64.246.0.64]) by svr1.postgresql.org (Postfix) with ESMTP id 13ABFD1CA67 for ; Thu, 29 Jan 2004 23:06:07 -0400 (AST) Received: from [61.5.68.234] (helo=winxp) by noon.pghoster.com with asmtp (Exim 4.24) id 1AmOyx-00086m-BY; Thu, 29 Jan 2004 21:06:12 -0600 Message-ID: <003e01c3e6dd$f385a9d0$ea44053d@winxp> From: "Chris Travers" To: "MUKTA" , References: <00a801c3e669$004f08c0$ea08a8c0@mukta> Subject: Re: Date: Fri, 30 Jan 2004 10:03:49 +0700 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_002F_01C3E718.5BAC5D80" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - noon.pghoster.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - travelamericas.com X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.7 tagged_above=0.0 required=5.0 tests=HTML_40_50, REFERENCES X-Spam-Level: X-Archive-Number: 200401/278 X-Sequence-Number: 16671 This is a multi-part message in MIME format. ------=_NextPart_000_002F_01C3E718.5BAC5D80 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable You can also use PGexecParams() (see the libpq documentation). It can be a= little more cumbersome to use, though. Best Wishes, Chris Travers ----- Original Message -----=20 From: MUKTA=20 To: pgsql-sql@postgresql.org=20 Sent: Thursday, January 29, 2004 8:08 PM Subject: [SQL]=20 Hi I have an urgent problem I want to insert values into a table using the C syscalls provided by the= libpq library, but i find that i can not insert into the table when i use = variables instead of values...like so: int a,b,c,d; using the C function=20 res=3DPQexecute(Conn,"INSERT into table values(a,b,c,d));.... executing above statement with plain integers does fine and inserts them = into table.. Is there some special way to insert variables rather than plain values? d= o i have to build functions (in sql) or somehting?help! Thanx ------=_NextPart_000_002F_01C3E718.5BAC5D80 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
You can also use PGexecParams() (see the l= ibpq=20 documentation).  It can be a little more cumbersome to use,=20 though.
 
Best Wishes,
Chris Travers
----- Original Message -----
Fro= m:=20 = MUKTA=20
To: pgsql-sql@postgresql.org
Sent: Thursday, January 29, 2004 8= :08=20 PM
Subject: [SQL]

Hi I have an urgent problem
I want to insert values into a table usi= ng the C=20 syscalls provided by the libpq library, but i find that i can not insert = into=20 the table when i use variables instead of values...like so:
int a,b,c,d;
using the C function
 
res=3DPQexecute(Conn,"INSERT into table= =20 values(a,b,c,d));....
 
executing above statement with plain integers does fine and inserts = them=20 into table..
 
Is there some special way to insert vari= ables=20 rather than plain values? do i have to build functions (in sql) or=20 somehting?help!
Thanx
------=_NextPart_000_002F_01C3E718.5BAC5D80--