How to maintain the history of code changes of pl/sql?
Answers were Sorted based on User's Feedback
Answer / arup ratan banerjee
U CAN REFER ALL_SOURCE TABLE...
SELECT * FROM ALL_SOURCE WHERE OWNER='IHIS11'
AND TYPE = 'PROCEDURE';
U will get procedure body from this table
|Is This Answer Correct ?||4 Yes||0 No|
Answer / guru
CREATE TABLE SOURCE_HIST -- Create
AS SELECT SYSDATE CHANGE_DATE, USER_SOURCE.*
FROM USER_SOURCE WHERE 1=2;
CREATE OR REPLACE TRIGGER change_hist --
Store code in hist table
AFTER CREATE ON SCOTT.SCHEMA --
Change SCOTT to your schema name
if DICTIONARY_OBJ_TYPE in ('PROCEDURE', 'FUNCTION',
'PACKAGE', 'PACKAGE BODY', 'TYPE')
-- Store old code in SOURCE_HIST table
INSERT INTO SOURCE_HIST
SELECT sysdate, user_source.* FROM USER_SOURCE
WHERE TYPE = DICTIONARY_OBJ_TYPE
AND NAME = DICTIONARY_OBJ_NAME;
WHEN OTHERS THEN
|Is This Answer Correct ?||5 Yes||2 No|
what is sql profiler? : Sql dba
Is not equal in sql?
What are sql injection vulnerabilities?
Can a select statement fire a trigger?
What is a natural join?
what is the use of HASH, LIST partitions?
How do I run a query in pl sql developer?
What is an index? What are the types of indexes? How many clustered indexes can be created on a table?
Can we use pl sql in sql server?
What is a variable in sql?
Define select, insert, create, delete, update, drop keywords
Differentiate between sga and pga.