Tracking PL/SQL Code Changes [message #228817] |
Wed, 04 April 2007 05:41  |
janetwilson
Messages: 48 Registered: June 2006 Location: St.Louis
|
Member |
|
|
Hi All,
Can anyone please advice me how to track the PL/SQL Code changes.
I tried with DDL Trigger.
But it is not working.
The Steps i tried are
Created a before Create Trigger and stored the codes in one table.
Created an after create trigger and stored in another table.
and tried to store the difference in another table using MINUS Operator.
Can anyone please help me whether the method i followed is the correct one or not.
I just want to store the PL/SQL Code type(Procedure/Function/Package) and the line number the text that has changed.
PLease guide me.
Regards
Janet
|
|
|
|
|
|
Re: Tracking PL/SQL Code Changes [message #228880 is a reply to message #228865] |
Wed, 04 April 2007 08:20   |
janetwilson
Messages: 48 Registered: June 2006 Location: St.Louis
|
Member |
|
|
Code Updated
Before Create Trigger
CREATE OR REPLACE TRIGGER LOGGINGB4_PLSQL
BEFORE CREATE
ON SCOTT.SCHEMA
DECLARE
BEGIN
IF ora_dict_obj_type='FUNCTION' THEN
-- INSERT INTO TEST123 VALUES('MODIFYING FUCNTION '||ora_dict_obj_name);
INSERT INTO LOG_TEMP SELECT ora_login_user,SYSDATE, line,text FROM USER_SOURCE WHERE NAME=ora_dict_obj_name ORDER BY line ASC;
END IF;
END TEST;
/
After DDL Trigger
CREATE OR REPLACE TRIGGER SCOTT.LOGGING_AFTERPLSQL
AFTER DDL
ON SCOTT.SCHEMA
DECLARE
BEGIN
IF ora_dict_obj_type='FUNCTION' THEN
INSERT INTO LOG_TEMPAFTER SELECT ORA_LOGIN_USER, SYSDATE, LINE, TEXT FROM USER_SOURCE WHERE NAME=ORA_DICT_OBJ_NAME;
INSERT INTO TRACKING_PLSQL SELECT ORA_LOGIN_USER,SYSDATE,LINE,TEXT FROM LOG_TEMP MINUS SELECT ORA_LOGIN_USER,SYSDATE,LINE,TEXT FROM LOG_TEMPAFTER;
END IF;
END;
/
/
I have one sample function
Function
CREATE OR REPLACE FUNCTION Ret_Sal(EMPN IN NUMBER) RETURN VARCHAR2 IS
vsal NUMBER;
BEGIN
SELECT sal INTO vsal FROM EMPLOYEE WHERE empno=EMPN;
RETURN vsal;
EXCEPTION
WHEN NO_DATA_FOUND THEN
RETURN 'PLEASE CHECK THE EMP NUMBER';
END Ret_Sal;
/
After Recompiling these with some changes like changing number to int. contents of the two tables log_temp and log_tempafter are same.
Janet
[Updated on: Wed, 04 April 2007 08:23] Report message to a moderator
|
|
|
|
|
|
|
|
Re: Tracking PL/SQL Code Changes [message #229130 is a reply to message #229126] |
Thu, 05 April 2007 08:56   |
JRowbottom
Messages: 5933 Registered: June 2006 Location: Sunny North Yorkshire, ho...
|
Senior Member |
|
|
TOAD will integrate very nicely with VSS, allowing you to checkout and checkin from the Procedure Editor.
Sql*Developer doesn't support any integration as far as I know.
|
|
|
Re: Tracking PL/SQL Code Changes [message #229134 is a reply to message #229130] |
Thu, 05 April 2007 09:10   |
janetwilson
Messages: 48 Registered: June 2006 Location: St.Louis
|
Member |
|
|
I tested the integration of VSS with Toad.
Installed Server Side Objects and Enabled the Check-in/Check-out options.
But while going to Team Coding ==> Team Coding Status ==> Settings i'm geeting a information message sayinfg the connection is read only.
Attached is the screen shot of the error.
Janet
[Mod-edit: Replaced >200kB .bmp with <10 kB .png]
-
Attachment: Error.PNG
(Size: 9.11KB, Downloaded 1709 times)
[Updated on: Thu, 05 April 2007 11:09] by Moderator Report message to a moderator
|
|
|
|
|
Re: Tracking PL/SQL Code Changes [message #229565 is a reply to message #229454] |
Mon, 09 April 2007 02:35   |
janetwilson
Messages: 48 Registered: June 2006 Location: St.Louis
|
Member |
|
|
Hi Andrew,
i had gone thru the article.
It is not working...
While creating the package body getting errors.
GET_ERRORS a function is present in package body but bot in package specification.
Janet..
|
|
|
|
|
|
Re: Tracking PL/SQL Code Changes [message #230016 is a reply to message #229979] |
Tue, 10 April 2007 09:55  |
andrew again
Messages: 2577 Registered: March 2000
|
Senior Member |
|
|
Hmmm... I must have missed it. Try basic things like compiling all the specs first, then the bodies. If it still won't work - try posting further questions on that page for the author to answer himself. Don't forget to mention the version of Oracle you are using.
|
|
|