Search Postgresql Archives

Re: how to check SQLSTATE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



sorry, forgot to mention psql8.1.4 on fedora core 4

On 10/6/06, A. Kretschmer <andreas.kretschmer@xxxxxxxxxxxxxx > 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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux