Oracle stored procedures and functions

Source: Internet
Author: User

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;

 


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.