![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi Is there any way one can query for a specific procedure's source code, rather than the entire package body that it's within? I know I can query user_source for the package body, or for stand-alone procs, but I'm struggling to find a nice way of pulling out just the code for a specific proc within the package. I suppose I can pull out everything between the start of the proc I want through to the start of the next proc, but I'd've thought there'd be a more elegant way of doing it than that? I'm looking @ Oracle 9i at present, but I'd be keen to know about solutions for other releases too. Any thoughts @ all, really. |
#3
| |||
| |||
|
|
Adam Cameron wrote: Hi Is there any way one can query for a specific procedure's source code, rather than the entire package body that it's within? I know I can query user_source for the package body, or for stand-alone procs, but I'm struggling to find a nice way of pulling out just the code for a specific proc within the package. I suppose I can pull out everything between the start of the proc I want through to the start of the next proc, but I'd've thought there'd be a more elegant way of doing it than that? I'm looking @ Oracle 9i at present, but I'd be keen to know about solutions for other releases too. Any thoughts @ all, really. when posting an issue such as this, it is helpful if you include the full version (ie: 9.2.0.?) Check out: Summary of DBMS_METADATA Subprograms http://download.oracle.com/docs/cd/B...d2.htm#1028659 search for "procedure" on that page... |
#4
| |||
| |||
|
|
Check out: Summary of DBMS_METADATA Subprograms http://download.oracle.com/docs/cd/B...d2.htm#1028659 search for "procedure" on that page... |
|
I'm looking @ Oracle 9i at present, but I'd be keen to know about solutions for other releases too. Any thoughts @ all, really. when posting an issue such as this, it is helpful if you include the full version (ie: 9.2.0.?) |
#5
| |||
| |||
|
|
Check out: Summary of DBMS_METADATA Subprograms http://download.oracle.com/docs/cd/B...d2.htm#1028659 search for "procedure" on that page... Cheers for your response, Michael: I'll look into the link you metioned. |
#6
| |||
| |||
|
|
Afaik, there is no such method in Oracle. You can get the whole package source (either from *_source or with dbms_metadata ), but then you have to parse it to obtain a code for particular packaged procedure/function. I personally would avoid to write a plsql parser in plsql. Perl,python,java,whatever else are much better suitable for that (it is not as trivial as to search for "procedure foo", even not with "regexp_like(text,"procedure\s+foo") etc). |
#7
| |||
| |||
|
|
Check out: Summary of DBMS_METADATA Subprograms http://download.oracle.com/docs/cd/B.../a96612/d_meta... search for "procedure" on that page... Cheers for your response, Michael: I'll look into the link you metioned. * I'm looking @ Oracle 9i at present, but I'd be keen to know about solutions for other releases too. *Any thoughts @ all, really. when posting an issue such as this, it is helpful if you include the full version (ie: 9.2.0.?) Like I suggested, I was not after a version specific solution, just wanting to know about techniques in general. But if we *were* considering just 9i, do you think there's much likelihood that the answer to my question would have been any different had I said 9.2.0.1 or 9.2.0.8, for argument's sake? |
![]() |
| Thread Tools | |
| Display Modes | |
| |