Procedure and function programming in PL/SQL

Source: Internet
Author: User

Procedure and function programming in PL/SQL

Procedure: Stored procedure eg: create or replace procedure p -- here is the difference with plsql iscursor cisselect * from emp2 for update; -- v_temp c % rowtype; begin for v_temp in cloopif (v_temp.sal <2000) thenupdate emp2 set sal = sal * 2 where current of c; elsif (v_temp.sal = 5000) thendelete from emp2 where current of c; end if; end loop; commit; end; command for executing the process: exec p; begin p end; stored procedure with parameters; create or replace procedure p -- in indicates that the out parameter is passed in, (v_a in number, v_ B number, v_ret out number, v_temp in out number) is beginif (v_a> v_ B) thenv_ret: =

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.