Oracle stored procedure and serialized write demo

Source: Internet
Author: User

Oracle stored procedure and serialized write demo 1. create an Oracle stored procedure, set a parameter n, run the stored procedure, and pass the parameter n. After the execution, the output is five times hello world. Note: The for loop is used in the stored procedure, run exec [java] create or replace procedure Hello (n in number) is begin for I in 1 .. n loop dbms_output.put_line ('Hello World'); end loop; end;/[java] -- open the output set serveroutput on; [java] -- execute this function execute hello (5 ); 2. create a sequence (Initial Value 1030, step 1), and use this sequence to insert two data records to the emp table (the sequence creation statement and the data insertion statement are required) [java] create sequence myse increment by 1 start with 1030; insert into emp_xxx values (myse. nextval, 'zhang Wuji ', 'manager', '12-January--10', 10 );

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.