Can we use sqlcode in functions of plpgsql

Started by tushar neheteover 14 years ago2 messagesgeneral
Jump to latest
#1tushar nehete
tpnehete@gmail.com

Hi,
For backward compatibility and some other reasons we want to use
SQLCODE in our functions of PLPGSQL.
But in Postgres Server 9.0 it gives error for SQLCODE.
Is there any way to use SQLCODE in functions of PLPGSQL at the place of
SQLSTATE?
Also what is the datatype of SQLSTATE?

#2Pavel Stehule
pavel.stehule@gmail.com
In reply to: tushar nehete (#1)
Re: Can we use sqlcode in functions of plpgsql

Hello

2011/10/7 tushar nehete <tpnehete@gmail.com>:

Hi,
For backward compatibility and some other reasons we want to use
SQLCODE in our functions of PLPGSQL.
But in Postgres Server 9.0 it gives error for SQLCODE.
Is there any way to use SQLCODE in functions of PLPGSQL at the place of
SQLSTATE?

you can hack PL/pgSQL source code. There are no other way

Also what is the datatype of SQLSTATE?

char(5)

Regards

Pavel Stehule

Show quoted text