data inserting in embedded C/libpq

Started by planx plnetxalmost 26 years ago1 messagesgeneral
Jump to latest
#1planx plnetx
planetx2100@hotmail.com

How I can insert data in Postgres with embedded sql?
May I can build a string like

char *query;
sprintf
(query,"INSERT INTO %s (%s) (%s) VALUES (%s)",table,field,value);

and process with PQexec(conn, query)?
my doubts is that PQexec is for queries and it must return a string...

how I can do in other ways?
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com