Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Any way to "conditionally" drop a table?
David M. Karr wrote:
>This is probably a FAQ, but I haven't been able to find any good
>information about this. Perhaps that means the answer is that I can't
>do it, but I'll give it a try anyway.
>
>In writing db setup scripts, it's convenient to add a "drop table"
>statement before "create table" statements. This works fine if the
>table already existed. If the table didn't exist, the script fails.
>
>Is it practical/feasible to write Oracle-specific SQL that I can pass
>through JDBC that will only drop the table if it exists, and ignore it
>if it doesn't exist? I remember a colleague at another job doing this
>quite a while ago, but I can't remember how it was done.
>
>
I agree with Sybrand. What you propose is a disaster waiting to strike.
-- Daniel Morgan http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp damorgan_at_x.washington.edu (replace 'x' with a 'u' to reply)Received on Mon Oct 27 2003 - 17:49:02 CST