I created a script that modifies an sql script in certain logical way. It extracts texts between certain logical lines and sends the output to a new file. You can download the shell script from here and try executing it with the attached test.sql as input. I created this script to alter PeopleSoft Generated AlterByRename sqls into simple CREATE statements.
Extract_Text.sh
usage: ./Extract_text.sh
NOTE: After downloading this file, please REPLACE
< ; with <
> ; with >
There is no space between < and ; or > and ; (I've mentained the space because of issue with blogspot)
test.sql
Subscribe to:
Post Comments (Atom)
OCI - Attach Block Volume to Windows VM
Tip: Although creating and attaching Block Storage to a Windows VM is pretty straightforward (OCI documentation is pretty good for that), th...
-
PeopleSoft Compare Reports: The compare reports are critical tools for the Fit/Gap analysis and determining the effort to re-apply/re-d...
-
Download this document - ( .doc ) or ( .pdf ) Change Assistant Introduction Change Assistant (CA) was first released in PeopleTools 8.44. C...
-
Process group is crucial in securing the processes and jobs in the system. It is possible to restrict access to certain processes within Pe...
2 comments:
I would do in one line ... much faster than your while read loop!
awk '/^CREATE UNIQUE INDEX/{print "-- Create unique index #"++x}/^CREATE TABLE/{print "-- Create table #"++y}/^CREATE (UNIQUE INDEX|TABLE)/,/;/{print}' test.sql
Laurent, that's wonderful... I've heard of awk being very powerful command. Thank you very much for sharing this bit of information.
Post a Comment