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
Can we insert data into view?
1. is it possible to use the cursor atttibutes (%found ,% rowcount , %isopen , %notfound ) to our user defined cursor names ....... cursor cursor_name is select * from scott.emp if you use... cursor_name%found , %rowcount ,%isopen,%notfound...will it work... -------------------------- 2.what is the difference between the varray and index by table .. -------- 3. type type_name is table of number(8,3) index by binary_integer; identifier_name type_name; first , last , prior , next ,trim are the methods we can use it for the above type...simillary is there any way to apply for cursors... with thanks and regards..sarao...
What is the need of a partition key?
what tools available for managing mysql server? : Sql dba
what are enums used for in mysql? : Sql dba
Which command is used to delete a trigger?
Does truncate require commit?
Is it possible to sort a column using a column alias?
What are field types?
what is data control language? : Sql dba
What is user defined functions?
What is a procedure in pl sql?
What are the types of join and explain each?
what are the advantages and disadvantages of views in a database? : Sql dba
What is hibernate and its relation to sql?