X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A5AC7D7985 for ; Mon, 5 Sep 2005 23:09:59 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 77403-08 for ; Tue, 6 Sep 2005 02:09:53 +0000 (GMT) Received: from challengelogistics.com.au (unknown [203.48.241.83]) by svr1.postgresql.org (Postfix) with ESMTP id 8DDF4D806A for ; Mon, 5 Sep 2005 23:09:54 -0300 (ADT) Received: from isis.challengelogistics.com.au ([192.168.160.31]) by sameagle with InterScan Messaging Security Suite; Tue, 06 Sep 2005 12:09:52 +1000 Received: from sandy01.challengelogistics.com.au ([192.168.160.3]) by isis.challengelogistics.com.au with Microsoft SMTPSVC(6.0.3790.1830); Tue, 6 Sep 2005 12:11:07 +1000 From: "Bath, David" Reply-To: dave.bath@unix.net To: pgsql-sql@postgresql.org Subject: Equivalent of Oracle SQL%NOTFOUND in plpgsql Date: Tue, 6 Sep 2005 12:14:06 +1000 User-Agent: KMail/1.8 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200509061214.06644.dave.bath@unix.net> X-OriginalArrivalTime: 06 Sep 2005 02:11:07.0328 (UTC) FILETIME=[3DDF7C00:01C5B288] X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 required=5 tests=[none] X-Spam-Level: X-Archive-Number: 200509/41 X-Sequence-Number: 22588 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.bath@unix.net