Re: ECPG - bug in EXEC SQL WHENEVER NOT FOUND?

From: Michael Meskes <meskes(at)postgresql(dot)org>
To: Christian Rank <christian(dot)rank(at)rz(dot)uni-passau(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: ECPG - bug in EXEC SQL WHENEVER NOT FOUND?
Date: 2004-03-07 14:31:14
Message-ID: 20040307143114.GA11163@1
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)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(at)jabber(dot)org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2004-03-07 17:41:16 Re: recursive trigger
Previous Message Mage 2004-03-07 13:37:35 recursive trigger