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 is data definition language?
What are the sql commands?
Cite the differences between execution of triggers and stored procedures?
How can I change database name in sql?
Do stored procedures prevent sql injection?
How does rowid help in running a query faster?
Is oracle and sql same?
Can we join two tables without common column?
Why do we use triggers?
What is composite primary key in sql?
how would you write a query to select all teams that won either 2, 4, 6 or 8 games? : Sql dba
What is bind variable in pl sql?
Can we insert data in view?
What is #table in sql?
What is the difference between drop and truncate commands?