我正在尝试从游标中获取第一行。但我得到了 postgres 8.2 上未定义的错误语法。有人能帮帮我吗?谢谢!
在文档中提到它只能从 SQL 执行。
如下
create or replace function temp_test1() RETURNS void AS $$
declare
curs_ref REFCURSOR;
record_type record;
record_first record;
Begin
open curs_ref for select * from temp;
loop
fetch curs_ref into record_type;
if some_condition
fetch first from curs_ref into record_first;
end if
end