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 are the types of variable use in pl sql?

567


what are the authentication modes in sql server? How can it be changed? : Sql dba

703


How can I get the number of records affected by a stored procedure?

579


What is trigger explain with example?

552


How do you use a while loop in pl sql?

539






what is the command used to fetch first 5 characters of the string? : Sql dba

1136


What is a unique constraint?

610


What are the parts of a basic sql query?

517


What does desc stand for?

593


Explain 3 basic parts of a trigger.

843


Is inner join same as self join?

584


how tsql statements can be written and submitted to the database engine? : Transact sql

536


What are the ways on commenting in a pl/sql code?

513


How many rows can sqlite handle?

587


What is the difference between inner join and outer join?

532