RE: if EXISTS in ksh script
Posted in 1998
herbert.yates@cibavision.Novartis.com — — source: Informix-list mailing list archive (1991-1998)
CNT=$(dbaccess yourdatabase<<! 2>/dev/null
output to pipe "cat -u"
without headings
select count(*) from systables where tabname = "yourtabname";!
)
If [[ $CNT -gt 0 ]];then
the table exist
fi
Herbert Yates
Database Administrator
Herbert.yates@cibavision.novartis.com
(770)418-3322
-----Original Message-----
From: Don Boling [SMTP:dboling@vnet.net]
Sent: Wednesday, October 28, 1998 10:59 PM
To: informix-list@iiug.org
Subject: if EXISTS in ksh script
I am trying to test if a table exists in a korn shell script
before I execute "create table (...) "
I have not found any reference in Informix SQL manuals on how to
do this...
any suggestions would be greatly appreciated....
Don
dboling@vnet.net