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