The methods to view the stored procedure statement file in Oracle are: View the stored procedure definition: SELECT text FROM user_source WHERE type = 'PROCEDURE' AND name = 'Stored procedure name'; use the DBMS_METADATA.GET_DDL function: SELECT DBMS_METADATA. GET_DDL('PROCEDURE', 'stored procedure name') FROM DUAL;For stored procedures created from external script files, you can check the script_out_file path and open it with a text editor.
View the stored procedure definition directly
<code class="sql">SELECT text FROM user_source WHERE type = 'PROCEDURE' AND name = '存储过程名称';</code>
Use the DBMS_METADATA.GET_DDL function
<code class="sql">SELECT DBMS_METADATA.GET_DDL('PROCEDURE', '存储过程名称') FROM DUAL;</code>
View the underlying script file
If you created the stored procedure from an external script file, you can view the statement file by following these steps:
<code class="sql">SELECT script_out_file FROM dba_procedures WHERE procedure_name = '存储过程名称';</code>
Note:
user_source
view can only view stored procedures created by the current user. DBMS_METADATA.GET_DDL
Function requires DBA authority. The above is the detailed content of How to view stored procedure statement file in oracle. For more information, please follow other related articles on the PHP Chinese website!