Re: sql syntax
Posted in 2000
From: "Frankie" <kehunchi@cm1.hinet.net>
>
>Hello everybody:
> I want to check if a table exist in a database,what sql syntax can I
>write?
> Now my requirement is follow:(my DB is informix 7.3)
>
> If (table exist) then
> drop table
> create table
> ...
If you are running in batch mode (like:
dbaccess dbname scriptfile
)
rather than interactively (like:
dbaccess dbname
Q
N
<type in some SQL>
Escape
R
...
)
You can just put the DROP TABLE in. If the table's not there, it will report
an error, but just carry on.
Otherwise, you might need to look at a stored procedure. (In TFM.)
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Share information about yourself, create your own public profile at
http://profiles.msn.com.