From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | "Anna Langer" <anna_langer(at)hotmail(dot)com> |
Cc: | pgsql-sql(at)postgreSQL(dot)org |
Subject: | Re: [SQL] Questions about embedded-sql! |
Date: | 1999-04-20 14:35:30 |
Message-ID: | 13837.924618930@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
"Anna Langer" <anna_langer(at)hotmail(dot)com> writes:
> We are having some problems with writing embedded-sql. We want to
> write like this but it doesn't work. test1 is our table in our
> database.
> res = PQexec(conn, "select * from test1");
> if (!res || PQresultStatus(res) != PGRES_COMMAND_OK)
> {
> fprintf(stderr, "DECLARE CURSOR command failed\n");
> ...
A successful SELECT query will return status PGRES_TUPLES_OK,
not PGRES_COMMAND_OK. You probably adapted this code from
an example that was executing a command that cannot return
tuples (DECLARE CURSOR, no doubt?). PGRES_COMMAND_OK is the
right thing in that case.
You should read the documentation and sample programs
for libpq ...
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Thomas Lockhart | 1999-04-20 14:40:05 | Re: [INTERFACES] where did that date and time come from?? |
Previous Message | Maarten Boekhold | 1999-04-20 14:10:38 | Re: [SQL] Questions about embedded-sql! |