X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 8D9E430EFB2 for ; Tue, 17 Jun 2003 04:43:09 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 80277-02 for ; Tue, 17 Jun 2003 01:42:59 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id BCFD330DF16 for ; Tue, 17 Jun 2003 01:42:58 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h5H4gsU6010282; Tue, 17 Jun 2003 00:42:55 -0400 (EDT) To: Stephan Szabo Cc: "Tony G. Harris" , pgsql-sql@postgresql.org Subject: Re: Trouble porting a Oracle PL/SQL procedure to PL/pgSQL In-reply-to: <20030616191549.W78774-100000@megazone23.bigpanda.com> References: <20030616191549.W78774-100000@megazone23.bigpanda.com> Comments: In-reply-to Stephan Szabo message dated "Mon, 16 Jun 2003 19:17:57 -0700" Date: Tue, 17 Jun 2003 00:42:54 -0400 Message-ID: <10281.1055824974@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200306/170 X-Sequence-Number: 13928 Stephan Szabo writes: > On Mon, 16 Jun 2003, Tony G. Harris wrote: >> The problem is, when I call the function, I get: >> sql-practice=# select update_pay(); >> ERROR: pay_cursor: no such class >> WARNING: plpgsql: ERROR during compile of update_pay near line 2 >> ERROR: pay_cursor: no such class > I think it's complaining because you can't use pay_cursor%ROWTYPE. Yeah, you're right. I didn't believe that theory at first because the line number reference didn't point at the line with %ROWTYPE ... but upon digging into it I find that plpgsql's code for determining the line number to report is flat wrong for this case. (I've committed a quick fix into CVS tip, but I wonder whether the whole mechanism shouldn't be rethought. Calling plpgsql_scanner_lineno() all over the place doesn't seem real clean.) > Maybe declaring IndRec as being of type record may work (don't know > for certain). That's what I'd try. We don't consider that declaring a cursor creates a named rowtype ... I'm surprised that Oracle seems to think it does. regards, tom lane