Re: EXISTS syntax for SELECT INTO?
| From: | Mike Morris | Date: | Wed, 11 Oct 2006 20:53:53 +0000 |
| Subject: | Re: EXISTS syntax for SELECT INTO? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-42529@lists.php.net to get a copy of this message | ||
My advice:
Do a "drop table" first, ignoring any error that will result if it does not exist, then do
the "select
into". This is portable, too...
> I have a script that creates a table copy using SELECT INTO, but I want it
> to check if the new table already exists first. Does SQL support the EXISTS
> keyword for SELECT INTO statements (I'm running PG7)?
>
> If not, is there another way to do it in SQL? I'd rather not do it
> programmatically.
>
> Thanks in advance,
> Tony
>
Mike Morris
The Music Place
1617 Willowhurst Avenue
San Jose, CA 95125
(408) 445-ARTS (2787)
------------------------------------
Your Free Humorous Quote:
When asked the difference between a tax collector and a taxidermist:
'The taxidermist takes only your skin.'
- Mark Twain
------------------------------------