Equivalent of Oracle SQL%NOTFOUND in plpgsql

From: "Bath, David" <dave(dot)bath(at)unix(dot)net>
To: pgsql-sql(at)postgresql(dot)org
Subject: Equivalent of Oracle SQL%NOTFOUND in plpgsql
Date: 2005-09-06 02:14:06
Message-ID: 200509061214.06644.dave.bath@unix.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Folks,

Background:
I'm an old Oracle PL/SQL guy.
In PL/SQL I can write some like the following:
fetch cursorblah into blurble;
if cursorname%NOTFOUND .....
or use the more general SQL%NOTFOUND symbol that
is not specific to a cursor. There are similar
"easy" variables to get at the SQLSTATE code
and associated error message.

Question:
How do I read the sqlstate for either/or the
most recent SQL command or a nominated cursor
from within plpgsql? I can find relevant info
for C/spi stuff, but can't see it for plpgsql.
Am I blind, not looking in the right spot,
is it undocumented, or unimplemented?

Thanks in advance
--
David T. Bath
dave(dot)bath(at)unix(dot)net

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2005-09-06 02:21:03 Re: Equivalent of Oracle SQL%NOTFOUND in plpgsql
Previous Message Tom Lane 2005-09-05 17:31:44 Re: POSIX Regular Expression question