Re: EXISTS syntax for SELECT INTO?

From: Date: Wed, 11 Oct 2006 21:04:32 +0000
Subject: Re: EXISTS syntax for SELECT INTO?
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-42530@lists.php.net to get a copy of this message
Thanks Mike. Luckily, I don¹t need the data if the table already exists so that should work. Tony On 10/11/06 2:53 PM, "Mike Morris" <mike@musicplace.com> wrote: > 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 > ------------------------------------ >

« previous php.db (#42530) next »