Re: [INTERFACES] Questions about pq library and ecpg

From: Michael Meskes <meskes(at)postgresql(dot)org>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: [INTERFACES] Questions about pq library and ecpg
Date: 1999-04-10 10:01:04
Message-ID: 19990410120104.E2048@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)Meskes(at)gmx(dot)net | Use PostgreSQL!

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Michael Davis 1999-04-10 15:23:09 RE: [INTERFACES] RE:
Previous Message Michael Meskes 1999-04-10 10:00:11 Re: [INTERFACES] Questions about pq library and ecpg