On Sat, Mar 06, 2004 at 09:54:13PM +0100, Christian Rank wrote:
> Today I ran into problems when combining a C program with SQL statements
> with the ECPG interface of PostgreSQL:
>
> According to the documentation, it should be possible with
> EXEC SQL WHENEVER NOT FOUND action
> to trigger an action when a query does not return a row.
Yes, that should work.
> Is this a bug in ECPG or am I doing something wrong?
Which version are you using? I get this:
postgres@feivel:/home/postgres/pgsql/src/interfaces/ecpg$ ./a
[21964]: ECPGdebug: set to 1
[21964]: ECPGconnect: opening database mm on <DEFAULT> port <DEFAULT>
[21964]: ECPGexecute line 16: QUERY: select n from t on connection mm
[21964]: ECPGexecute line 16: Correctly got 0 tuples with 1 fields
[21964]: raising sqlcode 100 in line 16, 'No data found in line 16.'.
no data found
[21964]: ecpg_finish: Connection mm closed.
Looks okay, doesn't it?
Michael
--
Michael Meskes
Email: Michael at Fam-Meskes dot De
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!