Re: [INTERFACES] Questions about pq library and ecpg - Mailing list pgsql-interfaces

From Michael Meskes
Subject Re: [INTERFACES] Questions about pq library and ecpg
Date
Msg-id 19990410120104.E2048@gmx.net
Whole thread Raw
In response to Re: [INTERFACES] Questions about pq library and ecpg  (Herouth Maoz <herouth@oumail.openu.ac.il>)
List pgsql-interfaces
On Sun, Mar 28, 1999 at 06:37:28PM +0200, Herouth Maoz wrote:
> It can easily be done with libpq, though. Instead of what you wrote above,
> you simply have to build the query correctly:
>
> strcpy( str, 'table_name' );
>
> sprintf( query, "INSERT INTO %s VALUES ('%s', %d)", str, "Rome", 10 );
>
> result = PQexec( conn, query );

Which is essantially the same as

exec sql execute immediate :query;

:-)

Michael
--
Michael Meskes                         | Go SF 49ers!
Th.-Heuss-Str. 61, D-41812 Erkelenz    | Go Rhein Fire!
Tel.: (+49) 2431/72651                 | Use Debian GNU/Linux!
Email: Michael.Meskes@gmx.net          | Use PostgreSQL!

pgsql-interfaces by date:

Previous
From: Michael Meskes
Date:
Subject: Re: [INTERFACES] Questions about pq library and ecpg
Next
From: Michael Davis
Date:
Subject: RE: [INTERFACES] RE: