[pgsql-jp: 38144] Stored Procedure

Admin chiwaki @ naigainitto.com
2007年 3月 14日 (水) 14:45:43 JST


千脇です

全てのアプリを98,W2K上で書いてきたので,XPに去年からしてアプリが動作しな 
くて困っています。
ましてや今はVISTAのみが売られているようで、お先真っ暗です。
そこでopensourceに乗り換えようと思っているのですが、現在使用中の 
SybaseSQLAnywhereでは
頻繁にstored procedureを用いており、それをSQLServer2Kなどで1)は実行で 
きないので、
PostGreSQLでは、どうかと思い皆様のお知恵を拝借したいと思いまして。

1)stored procedureは、tableとして使えますか?
つまりselect文の中で、stored procedureは使えますか?

select cust_name,parts,loc,qty from sp_expired_parts('2006/12/31') 
a,cust_mast b where a.cust_code=b.cust_code


2)common文中(with)に,recursive句を使えますか?

PROCEDURE gen_no(fr_no integer,to_no integer)
begin


with recursive num(nu) as
(select fr_no
union all
select nu+1 from num where nu <= to_no
)
select nu from num;

end




pgsql-jp メーリングリストの案内