1
获取的数据我已经成功地创建了返回集合光标的功能,即:PostgreSQL的 - 显示光标
CREATE OR REPLACE FUNCTION select_multiple(refcursor, refcursor)
RETURNS SETOF refcursor AS
$BODY$
BEGIN
OPEN $1 FOR SELECT testtemptable.myid FROM testtemptable; -- Open the first cursor
RETURN NEXT $1; -- Return the cursor to the caller
OPEN $2 FOR SELECT testtemptable.name FROM testtemptable; -- Open the second cursor
RETURN NEXT $2; -- Return the cursor to the caller
END;
$BODY$
LANGUAGE plpgsql VOLATILE
我所说的功能,我希望每个光标返回5行,这看起来正在发生。下面是我做的称呼它:
BEGIN;
select select_multiple('a', 'b');
FETCH ALL IN "a";
FETCH ALL IN "b";
COMMIT;
我的问题是,但是,我怎么能“可视化”的数据来验证所返回什么? “数据输出”选项卡中显示什么都没有,和“消息”选项卡显示
Query result with 2 rows discarded.
Query result with 5 rows discarded.
Query result with 5 rows discarded.
Query returned successfully with no result in 11 ms.
到哪里去我的结果被舍弃,我怎么能在“数据输出”选项卡中显示他们呢? PostgreSQL版本9.1
你的脚本在psql中适合我。你有没有专门针对pgAdmin3的问题? – 2013-03-20 09:30:04
是的,我认为这是pgAdmin3特有的。我会尝试在psql中运行我的脚本,如果必须的话,谢谢。 – Evgeny 2013-03-21 03:36:31