Re: how to check SQLSTATE
От | Hugo |
---|---|
Тема | Re: how to check SQLSTATE |
Дата | |
Msg-id | f3d9ba990610060549ibb73ab9o2d9c09b856232b2@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: how to check SQLSTATE ("A. Kretschmer" <andreas.kretschmer@schollglas.com>) |
Список | pgsql-general |
sorry, forgot to mention psql8.1.4 on fedora core 4
On 10/6/06, A. Kretschmer <andreas.kretschmer@schollglas.com > wrote:
am Thu, dem 05.10.2006, um 17:45:36 -0300 mailte Hugo folgendes:
> Hi,
>
> is it possible to check for sqlstate inside a function , something like:
> ....
> loop
> fetch bla.....
> if sqlstate = '02000' then
> exit;
> end if;
> ....
> end loop;
> if I try to save the above I get a : sqlstate not defined error
Which version?
With release 8.1 you can use SQLSTATE and SQLERRM inside exception
blocks.
-> http://www.postgresql.org/docs/8.1/interactive/release-8-1.html
You can find the errorcodes there:
http://www.pgadmin.org/docs/1.4/pg/errcodes-appendix.html#errcodes-table
HTH, Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47215, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net
---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend
В списке pgsql-general по дате отправления: