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