Home » SQL & PL/SQL » SQL & PL/SQL » Is there any DBMS property or any other property to get Recent executed SQL from Procedure
Is there any DBMS property or any other property to get Recent executed SQL from Procedure [message #186185] Sun, 06 August 2006 20:47 Go to next message
rajesh_uppada
Messages: 4
Registered: August 2006
Junior Member
Q) Is there any DBMS property or any other property to get Recent executed SQL from Procedure, Like below?


Procedure Insertsupplier(OutSQL out varchar2)
is
begin
insert into supplier (supplier_id,supplier_name,contact_name) value (1,'JOHN','TOM')
commit;
OutSQL := ??? -- Here i want get above executed sql
end Insertsupplier;



// Assigning SQL in One variable getting back, This way I don’t want, Like below.

Procedure Insertsupplier(OutSQL out varchar2)
is
strsql varchar2;
begin
strsql := 'insert into supplier (supplier_id,supplier_name,contact_name) value (1,''JOHN'',''TOM'')';
execute immediate strsql;
commit;
OutSQL := strsql -- Like this I don't want
end Insertsupplier;
Re: Is there any DBMS property or any other property to get Recent executed SQL from Procedure [message #186200 is a reply to message #186185] Mon, 07 August 2006 01:25 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
The SQL statement is fixed so you have the 'INSERT INTO...' part. The values you pass are probably parameters, so you can get those too. For derived values or values that are filled through database triggers you can use the RETURNING clause.

MHE
Re: Is there any DBMS property or any other property to get Recent executed SQL from Procedure [message #186347 is a reply to message #186200] Mon, 07 August 2006 10:28 Go to previous messageGo to next message
rajesh_uppada
Messages: 4
Registered: August 2006
Junior Member
Thans for your response

But,

That SQL statement can be any thing like Insert or delete or craete View...

I want to get total executed SQL statement

Please do help

Thanks

Re: Is there any DBMS property or any other property to get Recent executed SQL from Procedure [message #186352 is a reply to message #186347] Mon, 07 August 2006 11:16 Go to previous message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
Then you are probably trying to AUDIT dml and ddl.

MHE
Previous Topic: Your help is needed.
Next Topic: Mutating trigge Issue...
Goto Forum:
  


Current Time: Sun Dec 04 18:56:23 CST 2016

Total time taken to generate the page: 0.07878 seconds