1:Connect oracle database
[tkms3in@linux-55:/home/tkms3in/rec/test20160324] $ sqlplus tkms3in/tkms3in@orcl60
SQL*Plus: Release 11.2.0.1.0 Production on Thu Mar 31 15:46:57 2016
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
2:Creat store procedure sample
SQL> CREATE OR REPLACE PROCEDURE TT
2 is
3 begin
4 DBMS_OUTPUT.PUT_LINE('SHABdddd');
5 END;
6 /
Procedure created.
2:Run the procedure sample
SQL> SET SERVEROUTPUT ON; (this line :can lead the result output to the screen)
SQL> EXECUTE TT; (this line:run the store procedure and the "TT" represent the sp_name)
SHABdddd (this line:output result )
PL/SQL procedure successfully completed.
3:check the sp content
SQL> select * from user_source; (this line :the sp_content is save in this table user_source)
NAME TYPE LINE
------------------------------ ------------ ----------
TEXT
--------------------------------------------------------------------------------
TT PROCEDURE 1
PROCEDURE TT
TT PROCEDURE 2
is
TT PROCEDURE 3
begin
NAME TYPE LINE
------------------------------ ------------ ----------
TEXT
--------------------------------------------------------------------------------
TT PROCEDURE 4
DBMS_OUTPUT.PUT_LINE('SHABdddd');
TT PROCEDURE 5
END;
阅读(2748) | 评论(0) | 转发(0) |