I have a fun maintenance project where I need to run thru a loop where
I am dropping tables and sequences in an Oracle DB. There are dozens
of them and I don't know if they exist or not. Some sequences exist
without corresponding tables as well (the drop sequence stuff is not
in the snippet below).
Is there a way to use try/catch to ignore the error if a table does
not exist and continue on down the list? Some other method? I can do
this one at a time but it would take hours.
<cfloop
from="1"
to="#ArrayLen(request.TableList)#"
index="ArrayRows">
<cfquery
username="#myDBUserName#"
password="#myDBPassword#"
datasource="#myDSN#">
DROP TABLE #request.TableList[ArrayRows]#
</cfquery>
</cfloop>
--
--Matt Robertson--
President, Janitor
MSB Designs, Inc.
mysecretbase.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:184402
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54