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!

searching for a particular pattern in PL/SQL code

kaericnSep 30 2016 — edited Oct 1 2016

I have this line of code:

user_alias   = SUBSTR(user_alias, 1, 3);

where this pattern grasping a particular column or variable for 3 character is a strong indictor our migration effort will fail..

We try to migrate a data element from 3 digits e.g. a4j,tkb to 8 digits e.g. xx123456,xy123456

across many of our production tables. So in this case the new format will fail.

When I do a search like this

select  * from dba_source where  instr('SUBSTR',UPPER(text))>0 and  instr('3',text) > 0

or

select  * from dba_source where  instr('SUBSTR',UPPER(text))>0 

It does not give me the line number or package/procedure manually.

What I did manually, is to locally a suspect table from TOAD, and then from TOAD describe object, I find the objects used by TOAD

and then open that object(package/procedure) and reading it manually to pinpoint the potential suspect.

Is there a better way.

We don't have a test database set up and we might not have a test database set up at all to do this migration in prod.

So our boss ask us to manually eyeball it but this is not very clever as our code base is over 200k+ and the database is not normailize

So that same one field can shows up at other places and that can fails the backend process after the migration.

Thanks for all the help.

We are on oracle 9i release 2

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 29 2016
Added on Sep 30 2016
5 comments
2,718 views