How to maintain the history of code changes of pl/sql?

Answer Posted / kuldeep

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



CREATE OR REPLACE TRIGGER trig_change_hist
AFTER CREATE ON SCHEMA
BEGIN
INSERT INTO SOURCE_HIST -- History table
SELECT SYSDATE, user_source.*
FROM USER_SOURCE
WHERE NAME = ORA_DICT_OBJ_NAME; --
EXCEPTION
WHEN OTHERS
THEN
raise_application_error (-20000, SQLERRM);
END;
/

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is db journal file?

508


Does pl/sql support create command?

564


How do you determine the current isolation level? : Transact sql

566


What is the use of primary key?

527


Why do we need databases?

553






When can we use the where clause and the having clause?

566


What is right join sql?

528


Name three sql operations that perform a sort.

570


What is rtm stands for?

567


Does truncate require commit?

530


What are %type and %rowtype for?

602


What is a unique key?

575


How does cross join work?

492


Are stored procedures faster than dynamic sql?

518


Why do we use cursors?

499