feature #4: create procedure for citizen
This commit is contained in:
12
resources/functions/citizen/find_citizen_by_user_id.sql
Normal file
12
resources/functions/citizen/find_citizen_by_user_id.sql
Normal file
@@ -0,0 +1,12 @@
|
||||
create or replace procedure find_citizen_by_user_id(in id uuid, inout resource json) language plpgsql as
|
||||
$$
|
||||
declare
|
||||
_id alias for id;
|
||||
begin
|
||||
select to_json(z) into resource
|
||||
from citizen as z
|
||||
where z.user_id = _id;
|
||||
end;
|
||||
$$;
|
||||
|
||||
-- drop procedure if exists find_citizen_by_user_id(uuid, inout json);
|
||||
Reference in New Issue
Block a user