A bit late to the game :)
A "rough" initial attempt and SEVERAL "holes" ... (functions, DDL clauses not at the beginning of the line,$0=tolower($0), etc. etc., ) ... but hopefully interesting (and I have run out of steam :)
$ cat awkit
/^create procedure/,/^end procedure/ {
if (($1=="create") && ($2 == "procedure"))
{fl=0; sub("[(].*[)]","",$3); procname=$3}
else
if (($1=="drop") && ($2=="table"))
fl=1;
else
if (($1=="create") && ($2=="table"))
fl=1;
else
if (($1=="alter") && ($2=="table"))
fl=1;
else
if (($1=="create") && ($2=="temp") && ($3=="table"))
fl=1;
else
if (($1=="end") && ($2 == "procedure;") && (fl==1))
printf "dbschema -d %s -f %s\n", dbname, procname;
}
$ dbschema -d stores_demo | awk -f awkit dbname=stores_demo
dbschema -d stores_demo -f "informix".dummy2
Note this is a "PoC" and not anything more than that :)
JJ
------------------------------
Jon Ritson
------------------------------
Original Message:
Sent: Tue November 09, 2021 12:20 PM
From: David Grove
Subject: DDL SPLs?
Thank you, all, for your comprehensive suggestions.
Perfect.
DG
------------------------------
David Grove
------------------------------
Original Message:
Sent: Mon November 08, 2021 06:34 PM
From: David Grove
Subject: DDL SPLs?
That's basically what I was thinking. I would do a quick review to make sure that "CREATE" and "ALTER" are comprehensive.
DG
------------------------------
David Grove
Original Message:
Sent: Mon November 08, 2021 06:28 PM
From: Paul Watson
Subject: DDL SPLs?
Grep for create and alter statements ?
A simple script will give you the spl names as well
Cheers
Paul
Paul Watson
Oninit LLC
+1-913-387-7529
www.oninit.com
Oninit®️ is a registered trademark of Oninit LLC