Re: Dropping views and dependencies -cgi to check dependencies
Posted in 2004
Here's a very simple perl script to check dependencies for anyone interested. I didn't develop this one. For each tablename or viewname returned you will need to rerun it until there is nothing returned. Run like: perl thisscriptname tablename or viewname #!/opt/perlxa/bin/perl (or path to your executable) use DBI; $dbh = DBI->connect("dbi:Informix:$ENV{DBENV}"); print "$_->[0]\\n" foreach (@{$dbh->selectall_arrayref(<<EOL, undef,$ARGV[0])}); select d.tabname from systables b, systables d, sysdepend where b.tabid = btabid and d.tabid = dtabid and b.tabname = ? EOL CKGeier@nwc.edu Sent by: owner-informix-list@iiug.org 06/30/2004 09:24 AM To informix-list@iiug.org cc Subject Re: Dropping views and dependencies - OUCH Yea I have had a few good chuckles when I see people post things like "Gee I just dropped my database, how can I get it back?" I saw this post once somewhere. I guess the best I can hope for when I read that is that the person who dropped it works for my credit card company. ;-) Catherine Geier System Admin/IS support St. Paul, MN "Andrew Hamm" <ahamm@mail.com> Sent by: owner-informix-list@iiug.org 06/29/2004 07:17 PM Please respond to "Andrew Hamm" <ahamm@mail.com> To informix-list@iiug.org cc Subject Re: Dropping views and dependencies - OUCH CKGeier@nwc.edu wrote: > I just discovered that if I drop a view to recreate it; any dependent > views that use it also get dropped. What was Informix thinking on this > one??????? Wasn't there some way around this? It's due to the elegant simplicity of the tables storing the definition of the views. How's that for a spin... But seriously, informix doesn't support "invalid" views although by strange coincidence this exact same issue came up in this group about 2 weeks ago. Sounds like a great feature request for the next version of the engine. It can't be that difficult. > OUCH OUCH OUCH (But it's a good thing I have the code to recreate > them, whew!) Well duhhhhh - shame on anyone who doesn't! sending to informix-list sending to informix-list