Lucky me, I have to work with Oracle. And packages.
I have a package that a lot of different developers are touching and it’s scaring me. Is it possible to put a package inside of Version Control? Is there some kind of software out there that already does this? If not, is there some kind of export procedure? Can I just grab a file off of a file system?
How are they inputting it? The way we used to work at my last job is editing a text file, and loading it with SQL*Plus. You can just put that source file under version control.
The source must be between ‘
CREATE OR REPLACE PACKAGE MYPACKAGE AS‘ and ‘END;‘ followed by a single slash on a line of its own (‘/’); and ditto for ‘PACKAGE BODY’ instead of ‘PACKAGE’.And yes, there’s a way to pull the source out of Oracle. It’s in a table, line by line, look up ALL_SOURCE and USER_SOURCE. You can pull it out with a query like
(untested as I no longer have access to Oracle) and ditto for the ‘PACKAGE’.
I think it’s best to load it again into Oracle using SQL*Plus; make sure to set ‘SCAN OFF’.