aonestar
.public
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
sp_get_rategroup_by_id_json
Parameters
Name
Type
Mode
p_rategroup_id
integer
IN
Definition
declare v_result json; v_msg_text text; v_sqlstate text; v_detail text; v_hint text; v_context text; v_rategroup record; v_count_row int; messages jsonb = $${ "80001": "Not found data" }$$; begin select * into v_rategroup from rate_group rg where rg.id = p_rategroup_id; if found then return fn_result_success(row_to_json(v_rategroup)); else return fn_result_error('80001', messages->>'80001'); end if; 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_rategroup_by_id_json', null ); end;