26

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?

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
Madam Zu Zu
  • 6,437
  • 19
  • 83
  • 129

1 Answers1

50

check your casing, the name is typically stored in upper case

SELECT * FROM all_source WHERE name = 'DAILY_UPDATE' ORDER BY TYPE, LINE;

Harrison
  • 8,970
  • 1
  • 32
  • 28
  • 1
    Just a heads up, you might want to `order by line`. By default, the lines are correctly ordered for me without the `order by` in some quick testing, so I'm not sure if it is necessary or not – vikingsteve May 06 '15 at 11:14
  • IMHO `order by type` is useless since we already provided the name of the object – Ludovic Kuty Mar 07 '18 at 15:09
  • 1
    I actually put the ORDER BY TYPE (etc) there in case someone took the example and modified the WHERE clause (perhaps changing the = to a like etc); but you are correct, as an example I wanted it to work forward. I tend to like to always specify an ORDER BY in case things in the optimizer change in the future my queries will continue to operate as normal – Harrison Mar 08 '18 at 13:51
  • The ORDER BY TYPE Is relevant when displaying package code, as you want the package declaration to be listed before the package body. – volkerk Apr 09 '21 at 09:01