| From: | Hugo <htakada(at)gmail(dot)com> |
|---|---|
| To: | pgsql-general(at)postgresql(dot)org |
| Subject: | Fwd: how to check SQLSTATE |
| Date: | 2006-10-23 12:24:59 |
| Message-ID: | f3d9ba990610230524k558d4eavb42ed910939ad303@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
Hi,
Is there a way to check how many records where affected by a delete or
update sentence in a trigger function ??
thanks
Hugo
On 10/6/06, Hugo <htakada(at)gmail(dot)com> wrote:
>
> OK, thanks, I'm porting a lot of sybase storedprocedures, and there are
> lots of "if sqlstate.." statements that i need to translate to pgpsql,
> obviously I cannot use the SQLSTATE pseudo variable directly in my
> fuctions, according to the documentation i can be used in a exception block
> but couldn't find any examples, could you point me to some document or give
> some advice on how i could use sqlstate pseudo variable?
>
> thanks again
>
> Hugo
>
> On 10/6/06, Tom Lane < tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >
> > Hugo <htakada(at)gmail(dot)com> writes:
> > > Hi again, thanks for your guidance, this is the error I got trying to
> > save
> > > my fuction:
> > > ERROR: unrecognized exception condition "no_data"
> > > CONTEXT: compile of PL/pgSQL function "fn_verificar_aportes_socio"
> > near
> > > line 36
> >
> > NO_DATA isn't an error condition, only a warning, thus there is no case
> > in which an exception block would trap it. So plpgsql doesn't bother to
> >
> > recognize it.
> >
> > regards, tom lane
> >
>
>
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Arnaud Lesauvage | 2006-10-23 12:41:48 | Encoding problem |
| Previous Message | Hervé Piedvache | 2006-10-23 12:19:11 | Re: Wordpress & PostgreSQL ... |