Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Sql > Re: Create Tabl...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 2 Topic 3528 of 3799
Post > Topic >>

Re: Create Table Problem

by yazicivo@[EMAIL PROTECTED] (Volkan YAZICI) Jun 13, 2008 at 03:31 PM

"Shavonne Marietta Wijesinghe" <shavonne.marietta@[EMAIL PROTECTED]
> writes:
> IF (table not found) THEN
>     CREATE TABLE distributors (
>         did     integer,
>         name    varchar(40),
>         UNIQUE(name)
>     );
> END IF

Assuming you're in a procedure (above code snippet looks to be executed
within a PL/pgsql procedure):

  IF EXISTS (SELECT 1
               FROM information_schema.tables
              WHERE table_schema = 'public' AND
                    table_name   = 'distributors)
THEN ...
 END IF;


Regards.

-- 
Sent via pgsql-sql mailing list (pgsql-sql@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
 




 2 Posts in Topic:
Create Table Problem
shavonne.marietta@[EMAIL   2008-06-13 14:05:05 
Re: Create Table Problem
yazicivo@[EMAIL PROTECTED  2008-06-13 15:31:15 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Dec 2 21:30:27 CST 2008.