informix数据库中怎么判断一个表是否存在
有两种方法可以判断:
1.如果表名是静态的则可以使用
select count(*) from tablename
判断SQLCA.SQLCODE 是否等于 -206
2.如果表名是动态生成的则可以使用
select * from systables
where tabname = "tablename"
判断SQLCA.SQLCODE 是否等于 100
如:select * from bsn_hisdb@ol_history:systables where tabname='tablename';
1.如果表名是静态的则可以使用
select count(*) from tablename
判断SQLCA.SQLCODE 是否等于 -206
2.如果表名是动态生成的则可以使用
select * from systables
where tabname = "tablename"
判断SQLCA.SQLCODE 是否等于 100
如:select * from bsn_hisdb@ol_history:systables where tabname='tablename';
浙公网安备 33010602011771号