Skip site navigation (1) Skip section navigation (2)

Function Issue!

From: Theo Galanakis <Theo(dot)Galanakis(at)lonelyplanet(dot)com(dot)au>
To: pgsql-sql(at)postgresql(dot)org
Subject: Function Issue!
Date: 2004-08-19 01:10:00
Message-ID: 82E30406384FFB44AFD1012BAB230B55037D051E@shiva.au.lpint.net (view raw or flat)
Thread:
Lists: pgsql-sql
Can anyone tell me what is wrong with the function below ? 
It throws an ERROR:  syntax error at or near "FETCH" at character 551

CREATE OR REPLACE FUNCTION "public"."theo_test2" () RETURNS OPAQUE AS'
BEGIN
   declare curr_theo cursor for select * from node_names;
   fetch next from curr_theo;
   close curr_theo;
END;
'LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY DEFINER;


However, this appears to work :
begin;
 declare curr_theo cursor for select * from node_names;
 fetch next from curr_theo;
 close curr_theo;
end;


______________________________________________________________________
This email, including attachments, is intended only for the addressee
and may be confidential, privileged and subject to copyright.  If you
have received this email in error, please advise the sender and delete
it.  If you are not the intended recipient of this email, you must not
use, copy or disclose its content to anyone.  You must not copy or 
communicate to others content that is confidential or subject to 
copyright, unless you have the consent of the content owner.

Responses

pgsql-sql by date

Next:From: Tom LaneDate: 2004-08-19 01:36:09
Subject: Re: Function Issue!
Previous:From: Jan WieckDate: 2004-08-18 22:33:01
Subject: Re: multi column foreign key for implicitly unique columns

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group