Home » SQL & PL/SQL » SQL & PL/SQL » How can one keep a history of PL/SQL code changes?
icon14.gif  How can one keep a history of PL/SQL code changes? [message #214999] Thu, 18 January 2007 21:24 Go to next message
velu_cri
Messages: 2
Registered: January 2007
Location: CBE
Junior Member
Hi,
I have run the scripts given in the title : How can one keep a history of PL/SQL code changes? under the topic faq
->PL/SQL,in this 5th point.
It created the table source_hist and also the trigger change_hist.But the history of PL/SQL code changes is not stored in the table.How to resolve this?

Regards

V.Thangavelu.
Re: How can one keep a history of PL/SQL code changes? [message #215000 is a reply to message #214999] Thu, 18 January 2007 21:28 Go to previous messageGo to next message
BlackSwan
Messages: 25047
Registered: January 2009
Location: SoCal
Senior Member
By using CVS or other Source Code Control System (sccs, rvs, etc.)
Re: How can one keep a history of PL/SQL code changes? [message #215001 is a reply to message #214999] Thu, 18 January 2007 21:34 Go to previous messageGo to next message
velu_cri
Messages: 2
Registered: January 2007
Location: CBE
Junior Member
Hi,
I have run the following scripts given in the FAQ which is used to keep history of PL/SQL code changes.

CREATE TABLE SOURCE_HIST -- Create history table
AS SELECT SYSDATE CHANGE_DATE, USER_SOURCE.*
FROM USER_SOURCE WHERE 1=2;

CREATE OR REPLACE TRIGGER change_hist -- Store code in hist table
AFTER CREATE ON SCOTT.SCHEMA -- Change SCOTT to your schema name
DECLARE
BEGIN
if DICTIONARY_OBJ_TYPE in ('PROCEDURE', 'FUNCTION',
'PACKAGE', 'PACKAGE BODY', 'TYPE') then
-- Store old code in SOURCE_HIST table
INSERT INTO SOURCE_HIST
SELECT sysdate, user_source.* FROM USER_SOURCE
WHERE TYPE = DICTIONARY_OBJ_TYPE
AND NAME = DICTIONARY_OBJ_NAME;
end if;
EXCEPTION
WHEN OTHERS THEN
raise_application_error(-20000, SQLERRM);
END;
/
show errors

Regards

V.Thangavelu.
Re: How can one keep a history of PL/SQL code changes? [message #215033 is a reply to message #215001] Fri, 19 January 2007 01:15 Go to previous message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Which is NOT the proper solution if you take your application development serious.
Anacedent is right: use a Source Code Control System.
Previous Topic: Select Query for Column Name of Largest Value
Next Topic: Currval and disconnect
Goto Forum:
  


Current Time: Wed Dec 07 14:18:38 CST 2016

Total time taken to generate the page: 0.05235 seconds