Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 is data definition language?

1135


What are the sql commands?

1229


Cite the differences between execution of triggers and stored procedures?

1138


How can I change database name in sql?

1156


Do stored procedures prevent sql injection?

1014


How does rowid help in running a query faster?

1475


Is oracle and sql same?

1077


Can we join two tables without common column?

1058


Why do we use triggers?

1015


What is composite primary key in sql?

1043


how would you write a query to select all teams that won either 2, 4, 6 or 8 games? : Sql dba

1393


What is bind variable in pl sql?

1104


Can we insert data in view?

1008


What is #table in sql?

1180


What is the difference between drop and truncate commands?

1110