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!

Replace Text In SQL Scripts

447510Mar 28 2010 — edited Apr 1 2010
Hi,

I would like to search and replace text in files when I run .sql files.


E.g. When user provide scripts xyz.sql, they would put table name like
INSERT INTO  xyz abc VALUES ('text');
I would like to replace xyz abc with mytablename.
INSERT INTO  mytablename VALUES ('text');
Besides, from the user provided sql scripts, they would be some junk create table scripts, I would like to comment off these junk table scripts.

How could I do achieve the above?
I would be calling user provided sql scripts from my sql scripts using @ ./data/temp.sql

I am using oracle 8i for these. Any help is highly appreciable.

Regards
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 29 2010
Added on Mar 28 2010
17 comments
2,602 views