Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Function to find all occurence of a string line in a procedure

user10549528Jan 3 2019 — edited Jan 4 2019

Hello gurus,

I have a procedure purgedata like this.

Create or replace procedure purgedata

As

Vcount number;

   Begin

      Delete from table1 :

      Delete from table2;

      Select count(*) into vcount from table3;

      Select count(*) into vcount from table4 ;

      Delete from table5;

      Delete from table6;

       Delete from table100;

end;

The source code of the procedure is stored in user_source

I am trying to write a function that takes the source text as varchar parameter and return all table names where delete is happening or list all ' Delete from table' lines.

I want to capture all table name where delete is happening;

I can use metedata tables but that will also list tables where select is happening .

Please assist if it is possible.

Comments
Post Details
Added on Jan 3 2019
12 comments
447 views