Connecting Tech Pros Worldwide Forums | Help | Site Map

mysql question

lawrence k
Guest
 
Posts: n/a
#1: Dec 23 '05
If I write an update script, so people can upgrade their software to
the newest version I've written, and since the last version I've
created a new table in the database, so I want to add it, if it does
not already exist, is the syntax something like

create table if not exists subscribers

???


Kimmo Laine
Guest
 
Posts: n/a
#2: Dec 23 '05

re: mysql question


"lawrence k" <lkrubner@geocities.com> wrote in message
news:1135323786.086492.272160@o13g2000cwo.googlegr oups.com...[color=blue]
> If I write an update script, so people can upgrade their software to
> the newest version I've written, and since the last version I've
> created a new table in the database, so I want to add it, if it does
> not already exist, is the syntax something like
>
> create table if not exists subscribers
>[/color]

Exactly like that.
CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name
[(create_definition,...)]
[table_options] [select_statement]

http://dev.mysql.com/doc/refman/5.0/...ate-table.html

--
"En ole paha ihminen, mutta omenat ovat elinkeinoni." -Perttu Sirviö
antaatulla.sikanautaa@gmail.com.NOSPAM.invalid


Closed Thread