Re: how to check SQLSTATE

From: Hugo <htakada(at)gmail(dot)com>
To: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: how to check SQLSTATE
Date: 2006-10-06 12:49:20
Message-ID: f3d9ba990610060549ibb73ab9o2d9c09b856232b2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

On 10/6/06, A. Kretschmer <andreas(dot)kretschmer(at)schollglas(dot)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
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message hugoksouza 2006-10-06 13:24:54 Re: Installation on mandriva 2006
Previous Message Martins Mihailovs 2006-10-06 09:44:43 UTF-8