PL / Perl返回多行 [英] PL/Perl returning multiple rows

查看:54
本文介绍了PL / Perl返回多行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问候,


我正在尝试编写一个将返回多行的pl / perl函数。

我看了一遍网上只发现含糊的参考文件

这样做(有些人说这是可能的,有些人说这不是,但是

适用于旧版本Postgres)。


基本上我会*喜欢*能够做这样的事情:


SELECT some_id

FROM some_table

WHERE ....

INTERSECT

SELECT perlfunc(someparameter);


这是可能的,还是我需要将结果插入临时表格中?

并与之相交?


SELECT some_id

FROM some_table

WHERE ....

INTERSECT

SELECT some_id

来自temp_result
WHERE temp_id = perlfunc(someparameter);


任何指针都会非常感激。


提前谢谢。


干杯,


克里斯


-

Christopher Murtagh

企业系统管理员

ISR /网络通信组

麦吉尔大学

蒙特利尔,魁北克

加拿大


电话:(514)398-3122

传真:(514)398-2017


----- ----------------------(播出结束)----------------------- ----

提示6:您是否搜索了我们的列表档案?

http://archives.postgresql.org

解决方案

11月10日星期一, 2003年下午03:59:53 -0500,Christopher Murtagh写道:

我正在尝试写一个pl / perl函数,它将返回多行。
我'网上看起来只是模糊地提到了如何做到这一点(有些人说这是可能的,有些人说它不是,但是它/>是旧版本的Postgres。。




不幸的是,还没有启用pl / perl来返回多行。

显然它也可以通过实验界面使用SPI ...

所以plperl对你来说几乎是一个死胡同。


更好的开始学习Tcl .. 。


-

Alvaro Herrera(< alvherre [a] dcc.uchile.cl>)

"垄断一颗行星的能力是微不足道的

旁边的力量来源


--------------- ------------(广播结束)---------------------------

提示8:解释分析是你的朋友


在星期一,2003-11-10 16:52,Alvaro Herrera写道:

2003年11月10日星期一03:59:53 -0500,Christopher Murtagh写道:

我正在尝试写一个pl / perl函数返回多行。
我有在整个网络上都发布过,并且只发现了关于如何做到这一点的模糊参考(有些人说这是可能的,有些人说它不是,但它是用于旧版本的Postgres)。 / blockquote>

不幸的是,还没有启用pl / perl来返回多行。
显然它也只能通过实验界面使用SPI ...
所以plperl对你来说几乎是一个死胡同。

最好开始学习Tcl ...




感谢您的信息。我很喜欢,我喜欢Perl,但是我可以不用它来生活

。 :-)两个问题:


1)Tcl可以返回多行吗?


2)你知道我在哪里找到一些样本pl / tcl代码?我找到了

postgres docs,但那里没有很多。


3)好的,3个问题......任何关于pl / php和发布日期?


再次感谢。


干杯,


Chris


-

Christopher Murtagh

企业系统管理员

ISR / Web Communications Group

麦吉尔大学

蒙特利尔,魁北克

加拿大


电话:(514)398-3122 < br $>
传真:(514)398-2017


----------------------- ----(广播结束)---------------------------

提示5:你检查了吗?我们广泛的常见问题解答?

http:// www.postgresql.org/docs/faqs/FAQ.html





最好开始学习Tcl ...



我们现在折磨人们的是什么? plPython可以这样做吗?


感谢您的信息。我很好,我喜欢Perl,但我可以活着
没有它。 :-)两个问题:

1)Tcl可以返回多行吗?

2)你知道我在哪里可以找到一些样本pl / tcl代码吗?我找到了
postgres文档,但那里没有很多。

3)好的,3个问题......关于pl / php和发布日期的任何一个字?

再次感谢。

干杯,

Chris




-

Command Prompt,Inc。,Mammoth PostgreSQL的主页 - S / ODBC和S / JDBC

Postgresql支持,编程共享主机和专用主机。

+ 1-503-222-2783 - jd@commandprompt.com - http://www.commandprompt.com

Editor-N-Chief - PostgreSQl.Org - http://www.postgresql.org


----- ----------------------(播出结束)----------------------- ----

提示8:解释分析是你的朋友


Greetings,

I''m trying to write a pl/perl function that will return multiple rows.
I''ve looked all over the web and only found vague references as to how
to do this (some said it was possible, and some said it wasn''t but it
was for older versions of Postgres).

Basically I would *love* to be able to do something like this:

SELECT some_id
FROM some_table
WHERE ....
INTERSECT
SELECT perlfunc(someparameter);

Is this possible, or do I need to insert results into a temporary table
and intersect with that?

SELECT some_id
FROM some_table
WHERE ....
INTERSECT
SELECT some_id
FROM temp_result
WHERE temp_id = perlfunc(someparameter);

Any pointers would be much appreciated.

Thanks in advance.

Cheers,

Chris

--
Christopher Murtagh
Enterprise Systems Administrator
ISR / Web Communications Group
McGill University
Montreal, Quebec
Canada

Tel.: (514) 398-3122
Fax: (514) 398-2017

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

解决方案

On Mon, Nov 10, 2003 at 03:59:53PM -0500, Christopher Murtagh wrote:

I''m trying to write a pl/perl function that will return multiple rows.
I''ve looked all over the web and only found vague references as to how
to do this (some said it was possible, and some said it wasn''t but it
was for older versions of Postgres).



Unfortunately, pl/perl has not been enabled to return multiple rows yet.
Apparently it also can use SPI only through an experimental interface ...
so plperl is pretty much a dead end for you.

Better start learning Tcl ...

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"The ability to monopolize a planet is insignificant
next to the power of the source"

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend


On Mon, 2003-11-10 at 16:52, Alvaro Herrera wrote:

On Mon, Nov 10, 2003 at 03:59:53PM -0500, Christopher Murtagh wrote:

I''m trying to write a pl/perl function that will return multiple rows.
I''ve looked all over the web and only found vague references as to how
to do this (some said it was possible, and some said it wasn''t but it
was for older versions of Postgres).



Unfortunately, pl/perl has not been enabled to return multiple rows yet.
Apparently it also can use SPI only through an experimental interface ...
so plperl is pretty much a dead end for you.

Better start learning Tcl ...



Thanks for the info. I''m ok with that, I like Perl, but I can live
without it too. :-) Two questions:

1) Can Tcl return multiple rows?

2) Do you know where I can find some sample pl/tcl code? I''ve found the
postgres docs, but there isn''t a lot there.

3) ok, 3 questions... Any word on pl/php and a release date?

Thanks again.

Cheers,

Chris

--
Christopher Murtagh
Enterprise Systems Administrator
ISR / Web Communications Group
McGill University
Montreal, Quebec
Canada

Tel.: (514) 398-3122
Fax: (514) 398-2017

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html



.

Better start learning Tcl ...


What are we torturing people now? Can plPython do this?

Thanks for the info. I''m ok with that, I like Perl, but I can live
without it too. :-) Two questions:

1) Can Tcl return multiple rows?

2) Do you know where I can find some sample pl/tcl code? I''ve found the
postgres docs, but there isn''t a lot there.

3) ok, 3 questions... Any word on pl/php and a release date?

Thanks again.

Cheers,

Chris



--
Command Prompt, Inc., home of Mammoth PostgreSQL - S/ODBC and S/JDBC
Postgresql support, programming shared hosting and dedicated hosting.
+1-503-222-2783 - jd@commandprompt.com - http://www.commandprompt.com
Editor-N-Chief - PostgreSQl.Org - http://www.postgresql.org

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend


这篇关于PL / Perl返回多行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆