[GENERAL] Writing a user defined function

2008-07-18 Thread Suresh_
Hello, I am trying to code a simple udf in postgres. How do I write sql commands into pl/sql ? The foll. code doesnt work. CREATE OR REPLACE FUNCTION udf() RETURNS integer AS $$ BEGIN for i in 1..2000 loop for j in 1...1 loop end loop; begin work; declare cust scroll cursor for sele

Re: [GENERAL] Writing a user defined function

2008-07-19 Thread Suresh_
I get this error ERROR: syntax error at or near "cursor" CONTEXT: invalid type name "scroll cursor for select * from tpcd.customer" compile of PL/pgSQL function "udf" near line 5 Douglas McNaught wrote: > > On Fri, Jul 18, 2008 at 12:07 PM, Suresh_ &l