The first stored procedure for Oracle Learning: print Hello World

Source: Internet
Author: User

Database objects: Tables, views, indexes, sequences, synonyms, stored procedures, stored functions
Stored procedure: Refers to a subroutine stored in the database for all user programs called stored procedures, storage functions
Same point for stored procedures and stored functions: programs that complete a specific function
Differences between stored procedures and stored functions: Returns a value with a return statement (stored function can, but not stored procedure)


--The first stored procedure: print Hello world/*     call stored procedure 2 ways:     1, exec SayHelloWorld ();     2. Begin            SayHelloWorld ();            SayHelloWorld ();        End;        /*/create or Replace procedure SayHelloWorld  --assuming that the stored procedure exists for replace replacement otherwise create creates a non-parameter stored procedure as--cannot omit the begin   Dbms_output.put_line (' Hello World ');--note that it is not a double-cited but a single-argument, otherwise the call to the stored procedure will be error end;/

Connect Oracle Database in DOS form: Sqlplus username/[email PROTECTED]:1521/ORCL. or open the SQL Plus input username and password directly
Sql> set Serveroutput on
Sql> exec SayHelloWorld ();
Or:
Sql>begin
SayHelloWorld ();
SayHelloWorld ();
End
/


The first stored procedure for Oracle Learning: print Hello World

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.