在删除表之前检查现有的 [英] checking existing before drop a table

查看:62
本文介绍了在删除表之前检查现有的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何检查表是否存在然后删除它是否为true,false则忽略

SQL语句,例如,


drop table person如果存在;

解决方案

为什么要放下桌子?如果下降工作,那么你有你想要的b $ b。如果掉落失败,那么你就得到了你想要的东西。


失败的时候,我总是收到一条警告信息,有点恼火。 />

--CELKO--写道:

为什么只丢桌子?如果下降工作,那么你有你想要的东西。如果丢弃失败,那么无论如何你都有你想要的东西。




你可以查询syscat.tables


how to check if a table is exist then drop it if true, false to ignore
the SQL statement, for example,

drop table person if exist;

解决方案

Why just drop the table? If the drop works, then you have what you
wanted. If the drop fails, then you have what you wanted anyway.


when fails, I always get a warning message, it is a little annoyed.

--CELKO-- wrote:

Why just drop the table? If the drop works, then you have what you
wanted. If the drop fails, then you have what you wanted anyway.




you can query syscat.tables


这篇关于在删除表之前检查现有的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆