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--