How can I view the code of a stored procedure using sqlplus for Oracle 10g?
When I type in:
desc daily_update;
it shows me the parameter, but when I try to do the following:
select * from all_source where name = 'daily_update';
I get
no rows selected
What am I doing wrong?
Using SQL Server Management Studio Expand Databases, expand the database in which the procedure belongs, and then expand Programmability. Expand Stored Procedures, right-click the procedure and then click View Dependencies. View the list of objects that depend on the procedure.
sqlplus> spool myprocname. sql; sqlplus> select text from all_source where name = 'MYPROCNAME' and type = 'PROCEDURE' order by line; sqlplus> quit; then edit the local SQL file in a decent editor. Then use SQLPlus to run the SQL file to re-build the proc for testing.
You can use user_source or all_source data dictionary view to view the procedure or function code. Try this. You can replace PROCEDURE with the type you want. You can view the source code of a function or a procedure by using data dictionary views.
check your casing, the name is typically stored in upper case
SELECT * FROM all_source WHERE name = 'DAILY_UPDATE' ORDER BY TYPE, LINE;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With