Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How would I store PL/SQL scripts in a table? 1

Status
Not open for further replies.

mattmaycsg

Technical User
Mar 22, 2001
1
US
I'm on Oracle 8.1.7 and was wondering if anyone had any suggestions on how I could I store PL/SQL scripts in a table and be able to retrieve them while keeping the orginial formatting of the script i.e. spacing and hard returns? Thanks in advance.
-Matt
 
I would imitate the structure of the DBA_SOURCE catalog view. If this method is good enough for Oracle, it should be good enough for the rest of us. DBA_SOURCE contains source code for database objects, one line per row. To retrieve the source code of a stored procedure, for example, do a query like

SELECT TEXT FROM DBA_SOURCE
WHERE OWNER='OWNER_NAME'
AND NAME='PROCEDURE_NAME'
ORDER BY LINE;
 
As an alternative, you could explore using CLOB's to hold the data, I'm not sure what would happen with The Hard Carridge returns but they should be OK from what I've read.

Or, if you only want to read the scripts from the DB and rarely change them you could look at B files, this would allow you just to dump the scripts on the server and patch them into Oracle. I'vre never used these though so you'd have to look into it more.

Just some more ideas....

Mike.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top