List:General Discussion« Previous MessageNext Message »
From:Carsten H. Pedersen Date:October 6 1999 1:16pm
Subject:Re: TABLE EXISTS
View as plain text  
sinisa@stripped wrote:
> 
> toxalot@stripped writes:
>  > I see in the handbook that there is a way to see that a table exists before
>  > dropping it, but how do you check if one exists before trying to create it?
>  >
>  > Jennifer
> 
> Hi!
> 
> IF EXISTS works with DROP and CREATE, with a later being rather
> recent.
> 
> Sinisa

Alternatively, you can do "select 1 from <tablename>". You either
get a result set of one record containing a 1 or an error indicating
the table doesn't exist.

/ Carsten
Thread
TABLE EXISTStoxalot6 Oct
  • Re: TABLE EXISTSsinisa6 Oct
  • Re: TABLE EXISTSCarsten H. Pedersen6 Oct
    • Re: TABLE EXISTSPaul DuBois6 Oct
      • Re: TABLE EXISTStoxalot7 Oct