[pgsql-jp: 38127] Stored Procedure work with table ?
Admin
chiwaki @ naigainitto.com
2007年 3月 10日 (土) 14:42:00 JST
現在Sybase SQLAnywhereを使用しています。
これから全てをオープンソースに移行しようと検討しています。
そこでデータベースをPostGreSQL又はMySQLではどうかと思っていますが、
なにせ現在のDBに方言をたくさん使用しているので、移行がどうなるか心配です。
方言ではありませんが、derived table, common tableをstored procedureの中
で頻繁に使用し
そのstored procedureをtableと共に使っています。
select search_no,serial_no,incoming_date,parts,qty from
sp_inventory_result('2004/03/31') a, incoming_scan b
where a.parts=b.parts and a.search_no=b.search_no and
a.serial_no=b.serial_no
有効期限2004/03/31以前のもの一覧
あとrecursiveはSQLで使えますか?
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
Thank you
pgsql-jp メーリングリストの案内