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
What are the types of variable use in pl sql?
what are the authentication modes in sql server? How can it be changed? : Sql dba
How can I get the number of records affected by a stored procedure?
What is trigger explain with example?
How do you use a while loop in pl sql?
what is the command used to fetch first 5 characters of the string? : Sql dba
What is a unique constraint?
What are the parts of a basic sql query?
What does desc stand for?
Explain 3 basic parts of a trigger.
Is inner join same as self join?
how tsql statements can be written and submitted to the database engine? : Transact sql
What are the ways on commenting in a pl/sql code?
How many rows can sqlite handle?
What is the difference between inner join and outer join?