Received: from lin.local.lan ([216.221.221.2]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f19HwCx54400 for ; Fri, 9 Feb 2001 12:58:12 -0500 (EST) (envelope-from najm@mondo-live.com) Received: from mondo-live.com (IDENT:najm@ll20.local2.lan [192.168.2.20]) by lin.local.lan (8.9.3/8.8.7) with ESMTP id QAA18935 for ; Fri, 9 Feb 2001 16:52:36 GMT Message-ID: <3A858290.270E2473@mondo-live.com> Date: Sat, 10 Feb 2001 13:04:00 -0500 From: Najm Hashmi X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.14-5.0 i686) X-Accept-Language: en MIME-Version: 1.0 To: pgsql Subject: What's wrong with this function Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200102/174 X-Sequence-Number: 1360 Hi all, Here is a plpgsql function: flipr'#create function test_cur() returns text as' flipr'# declare flipr'# mycur cursor for select title from songs where song_id=10; flipr'# usr record; flipr'# results text; flipr'# begin flipr'# open mycur; flipr'# fetch next from mycur into usr; flipr'# close mycur; flipr'# results:= usr.title; flipr'# flipr'# end; flipr'# ' language 'plpgsql'; CREATE flipr=# select test_cur() as Title; NOTICE: plpgsql: ERROR during compile of test_cur near line 2 ERROR: parse error at or near "cursor" What I am doing wrong? Thanks in advance for your help. Regards, Najm