Re: sql syntax
Posted in 2000
Hi Frankie,
I don't think that's possible through SQL, but
you can do it using a 4GL program :
...
select count (*) into cnt_table
from systables
where tabname = "my_table"if cnt_table = 1 then
drop table my_table
end ifcreate table ...
...
Another possibility :
...
whenever error continue
drop table my_tablewhenever any error stop
create table ...
...
Hope it helps
Olmedo.
Frankie <kehunchi@cm1.hinet.net> a 'crit dans le message :
8usth1$2ia7$1@news.is.net.tw...
> 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
> ...
>
>
> Thank's everybody.
>
> --
> Frankie Ke
> Colovos Machinery Corp
> TEL:(04)4070810*203 FAX:(04)-4071129
> Email:kehunchi@cm1.hinet.net
>
>
>