From: hoelc <hoelc@pd.jaring.my>
To: pgsql-interfaces@postgresql.org
Subject: question on accessing PostgreSQL with C
Date: Sat, 06 Feb 1999 11:05:18 +0800
Message-ID: <36BBB16D.F0F88A26@pd.jaring.my> (raw)
Hello,
I'm a newbee in PostgreSQL, Linux world. Currently facing some problem
in building a simple application. I'm trying to write a C program that
get input from user, then update (insert / change) the database, or
retrieve selected data.
Questions:
(1) Where to get more example of communicating with PostgreSQL with C
program?
(2) How to put variables into the SQL?
I use C program to access PostgreSQL with libpq, and use PQexec( )
to send the query. One of the failed example of mine,
:
/* get input from user, a string and an integer */
:
PQexec(conn,"insert into NameList (name,id) values (%s,%d)
.......
:
/* I'm trying to put variables of string and integer into the
query */
(3) How to check who are the users in PostgreSQL system?
Please advise.
Thanks & Regards,
LCH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: hoelc@pd.jaring.my
Subject: Re: question on accessing PostgreSQL with C
In-Reply-To: <36BBB16D.F0F88A26@pd.jaring.my>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox