Re: ECPG - bug in EXEC SQL WHENEVER NOT FOUND? - Mailing list pgsql-general

From Michael Meskes
Subject Re: ECPG - bug in EXEC SQL WHENEVER NOT FOUND?
Date
Msg-id 20040307143114.GA11163@1
Whole thread Raw
In response to ECPG - bug in EXEC SQL WHENEVER NOT FOUND?  (Christian Rank <christian.rank@rz.uni-passau.de>)
Responses Re: ECPG - bug in EXEC SQL WHENEVER NOT FOUND?
List pgsql-general
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!

pgsql-general by date:

Previous
From: Mage
Date:
Subject: recursive trigger
Next
From: Tom Lane
Date:
Subject: Re: recursive trigger