lijiannan_1981
著名写手
著名写手
  • 铜币15枚
  • 威望0点
  • 贡献值0点
阅读:1168回复:0

存储过程

楼主#
更多 发布于:2006-03-22 09:21
create function snuffed_it_when (VARCHAR) returns integer '
declare
    poet_id NUMBER;
    poet_age NUMBER;
begin
    -- first get the id associated with the poet.
    SELECT id INTO poet_id FROM poets WHERE name = $1;
    -- get and return the age.
    SELECT age INTO poet_age FROM deaths WHERE mort_id = poet_id;
    return age;
end;
' language 'pl/pgsql';

无。
游客

返回顶部