Oracle stored procedures and functions
Create a stored procedure:
Create or replace procedure proc_trade (v_tradeid in tt_ B .number % TYPE, -- transaction id v_third_ip in transaction % TYPE, -- third-party ip v_third_time in tt_ B .date % TYPE, -- third-party completion time v_thire_state, -- third-party status o_result out tt_ B .number % TYPE, -- Return Value o_detail out tt_ B .varchar2% TYPE -- Detailed description) as -- variable value assignment o_result: = 0; o_detail: = 'verification failed '; -- business logic processing if v_tradeid> 100 then insert into table_name (...) values (...); commit; elsif v_tradeid <100 and v_tradeid> 50 then insert into table_name (...) values (...); commit; else goto log; end if; -- jump flag, with the name specified <log> o_result: = 1; -- catch exception when no_data_found then result: = 2; when dup_val_on_index then result: = 3; when others then result: =-1; end proc_trade;