Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Is it a table or a view

Re: Is it a table or a view

From: Daniel Morgan <damorgan_at_exxesolutions.com>
Date: Sat, 23 Aug 2003 10:42:53 -0700
Message-ID: <3F47A79D.7F9F7E82@exxesolutions.com>


Fredrik Wahlgren wrote:

> Hi
>
> In my client application, I want to delete a table that I have created. It's
> not a tempoary table but I use it as such. I have a method called drop table
> for this purpose. Before trying to drop the table, I check for existence by
> calling "SELECT COUNT(*) FROM user_tab_columns WHERE table_name =
> 'MyTempTable". I do this bcause I want to avoid errors.
>
> Now, I use this particular client to test various strategies to see what
> works best. I now think it would be worthwhile to let MyTempTable be a view
> instead of a table.
>
> I therefore need something likDropTableOrView, the idea beaing to use DROP
> VIEW if it's a view. How do I modify the first query so that it only finds a
> view with that name.
>
> I realize I could use a different naming scheme but I don't want to do that.
>
> Regards,
> Fredrik

I would suggest to you that you rethink this entire business of issuing DDL. What possible purpose is served dropping a view (personally I think dropping the table made no sense either)? Build the view and leave it alone.

Otherwise query all_views and use NDS to drop it.

--
Daniel Morgan
http://www.outreach.washington.edu/extinfo/certprog/oad/oad_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Sat Aug 23 2003 - 12:42:53 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US