|
阅读:1168回复:0
存储过程
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'; |
|
|