From: | Vidya <sivaramanvidhya(at)yahoo(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Cursor problem |
Date: | 2005-05-06 12:58:11 |
Message-ID: | 20050506125811.55332.qmail@web54310.mail.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hello All,
How do I create a cursor in psql .
I have a function which opens a cursor .
SampleDB=# create function reffunc(refcursor) returns refcursor as $$
SampleDB$# begin
SampleDB$# open $1 for select col from test;
SampleDB$# return $1;
SampleDB$# end;
SampleDB$# $$ language sql;
ERROR: syntax error at or near "open" at character 67
LINE 3: open $1 for select col from test;
I am not able to create a cursor , it errors out at 'open '
I tried a still more simple one
^
SampleDB=# create or replace function test(refcursor) returns refcursor as $$
SampleDB=#begin
SampleDB$# syscur refcursor;
SampleDB=#end;
SampleDB$# $$ language sql;
ERROR: syntax error at or near "syscur" at character 68
LINE 2: syscur refcursor;
How do I create a cursor .
Any help asap ?
Thanks
Vidya
---------------------------------
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
From | Date | Subject | |
---|---|---|---|
Next Message | Jeff - | 2005-05-06 13:01:58 | Re: Slony v. DBMirror |
Previous Message | Nageshwar Rao | 2005-05-06 12:56:14 | Extracting date from timestamp |