View stored procedure statements in Oracle database: 1. Query the data dictionary; 2. Use the DBMS_METADATA package; 3. Use a command line tool (such as SQL*Plus or SQL Developer).
View the statements of the stored procedures in the Oracle database
Query the data dictionary directly
<code class="sql">SELECT * FROM USER_PROCEDURES WHERE PROCEDURE_NAME = '存储过程名称';</code>
Use the DBMS_METADATA package
<code class="sql">SELECT DBMS_METADATA.GET_DDL('PROCEDURE', '存储过程名称') FROM DUAL;</code>
Use the command line tool (SQL*Plus or SQL Developer)
<code class="sql">SHOW PROCEDURE 存储过程名称</code>
Details Expand
Using the data dictionary
Data dictionary tableUSER_PROCEDURES
Stores information about the current user-defined stored procedure. The PROCEDURE_NAME
column contains the name of the stored procedure.
Using the DBMS_METADATA package
The DBMS_METADATA.GET_DDL
function returns the DDL statement for the specified object, including stored procedures.
Use the command line tool
SHOW PROCEDURE
command to display the source code of the stored procedure.
Example
View the stored procedure named GET_CUSTOMER_ORDERS
:
<code class="sql">SELECT * FROM USER_PROCEDURES WHERE PROCEDURE_NAME = 'GET_CUSTOMER_ORDERS';</code>
The above is the detailed content of oracle database view stored procedure statements. For more information, please follow other related articles on the PHP Chinese website!