Re: if EXISTS in ksh script
Posted in 1998
WF Software — — source: Informix-list mailing list archive (1991-1998)
In article <iJRZ1.6$If4.284636@ralph.vnet.net>, dboling@vnet.net (Don
Boling) wrote:
> 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
>
>
>
I like
EXIST=`dbaccess ${DBNAME} -<<EOF 2>/dev/null | awk '/ [0-9]/{print $1}'
select count(*)
from systables
where tabname = "{$TABNAME}"EOF
`
if [ ${EXIST} ]
then
else
fi
Paul Watson # I don't suffer from
WF Software Ltd. # stress, I'm just
Tel. (+44) 1436 674729 # a carrier
Fax. (+44) 1436 678693 #
www.wfsoftware.co.uk