aonestar
.public
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
sp_get_photo_user_guest_document
Parameters
Name
Type
Mode
p_data
jsonb
IN
o_photo_url
text
OUT
o_image_url
text
OUT
Definition
declare v_result json; v_msg_text text; v_sqlstate text; v_detail text; v_hint text; v_context text; v_guest_doc_id int; v_guest_doc_record record; begin v_guest_doc_id:=(p_data ->> 'guest_doc_id')::int4; select gd.photo_url ,gd.image_url into o_photo_url, o_image_url from guest_document gd where gd.id = v_guest_doc_id limit 1; if not found then o_photo_url:=null; o_image_url:=null; end if; return; -- return -- fn_result_success( -- -- coalesce( -- ( -- select json_build_object( -- 'photo_url' , gd.photo_url -- ,'image_url', gd.image_url -- ) -- from guest_document gd -- where gd.id = v_guest_doc_id -- limit 1 -- -- ), '{}'::json -- -- ) -- ); --exception -- when others then -- get stacked diagnostics -- v_msg_text = message_text, -- v_sqlstate = returned_sqlstate, -- v_detail = pg_exception_detail, -- v_hint = pg_exception_hint, -- v_context = pg_exception_context; -- -- return fn_handle_error( -- v_sqlstate, -- v_msg_text, -- v_detail, -- v_hint, -- v_context, -- 'sp_get_photo_user_guest_document_json', -- p_data -- ); end;