Skip site navigation (1) Skip section navigation (2)

Re: ECPG and EXEC SQL GET DIAGNOSTICS

From: kjw <kenneth69(at)usa(dot)net>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-interfaces(at)postgresql(dot)org, pg(at)fastcrypt(dot)com
Subject: Re: ECPG and EXEC SQL GET DIAGNOSTICS
Date: 2004-01-15 04:22:55
Message-ID: 4006159F.5000505@usa.net (view raw or flat)
Thread:
Lists: pgsql-interfaces
To all,
Thanks for responding to my question and sorry for the delay
in answering your reply.

Informix ESQLC (9.2.1 ) has functionality that allows you to get the 
status of
a previously excecuted sql statement.

/* there can be more than 1 exception, the "1" in the following example 
refers to the 1st exception" */
EXEC SQL get diagnostics  exception 1
:_srvrname = SERVER_NAME, :_sqlstate_code = RETURNED_SQLSTATE,
:_message = MESSAGE_TEXT, :_messlen = MESSAGE_LENGTH;

This would place the DB Server name, Error message text (if any) and the 
length
of the error message into the respective host variables.
This statement would compile and run under informix but fail
when compiled with ecpg (3.1.0/PostgreSQL 7.4.1) with the following 
error code.
"test.pgc:19: ERROR: syntax error at or near "diagnostics" "

Compilation command: "ecpg -c -C INFORMIX test.pgc"

I have attached test.pgc

Thanks to all,
ken



Peter Eisentraut wrote:

>kjw wrote:
>  
>
>>I am currently thinking about porting
>>Embedded esql/c code from informix to
>>PostgreSQL. It there any plans on incorporating
>>the "EXEC SQL GET DIAGNOSTICS" functionality?
>>    
>>
>
>It's already there.  What is missing?
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 4: Don't 'kill -9' the postmaster
>
>.
>
>  
>


Attachment: test.pgc
Description: text/plain (692 bytes)

In response to

Responses

pgsql-interfaces by date

Next:From: Goulet, DickDate: 2004-01-16 20:01:20
Subject: ECPG on WinDoze
Previous:From: Dave CramerDate: 2004-01-12 13:28:25
Subject: Re: ECPG and EXEC SQL GET DIAGNOSTICS

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group