Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Stored Procedures

Re: Stored Procedures

From: Tomm Carr <tommcatt_at_geocities.com>
Date: 1997/07/21
Message-ID: <33D38E0F.4B5A@geocities.com>#1/1

Steven H. wrote:
>
> Is there an easy way of retrieving stored procedures from
> a database (Oracle 7.1)? At the moment we have to do a
> select statement in SQL Plus to retrieve the code from one
> of the internal tables, but the output is not easy to manage -
> we have to select the output with the mouse and copy it into
> another program.

SQL> set pages 0       -- to turn off headers
SQL> select text ...   -- queries the source you want
SQL> set spool on <filename>  -- sets up a file to hold the source
SQL> /                 -- reexecutes the select 
SQL> set spool off

Now edit the file and strip away the "/" at the beginning and the "xxx rows returned" an the end and insert "create or replace" at the beginning.

OR...

Keep the source in an OS text file in the first place. When compiled, blank lines are stripped from the source and tabs can come out all wrong. I tend to use a lot of white space in my source and go to a lot of trouble with endenting. So when I, say, print a copy of a package I've written, I want it to look like the same one I wrote.

I guess what I'm saying is...don't do that! If you must, extract it once to a file, make it pretty and KEEP IT!

Of course, there is then the problem of several copies of a source file floating around several developers, but you DO have a source control system (PVCS, MKS, etc.) don't you???

-- 
Tomm Carr
--
"Can you describe your assailant?"
"No problem, Officer.  That's exactly what I was doing when he hit me!"
Received on Mon Jul 21 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US