select "该table存在" where EXISTS(SELECT * FROM robber) 你在用java的时候可以检测,如果有抛出错误,就可以断定该table不存在 或者 select "该table存在" where not EXISTS(SELECT * FROM robber)怎样做你应该知道了,:)
to robber: 抛出错误? 哪个异常可以做到? 好像不能区别开是表不存在还是其他的数据库错误.
you can run this sql string : select 'ifexist' from testformat; then check the value of sqlcode,if sqlcode=942 it means the table is not exist.
select count(*) from usertables where table_name='testformat'好像是这个,总之查查数据字典就可以了。 通常会直接运行create table,如果出错,就,如果不出错,就。两种办法。:)
EXISTS(SELECT *
FROM robber)
你在用java的时候可以检测,如果有抛出错误,就可以断定该table不存在
或者
select "该table存在" where
not EXISTS(SELECT *
FROM robber)怎样做你应该知道了,:)
抛出错误? 哪个异常可以做到? 好像不能区别开是表不存在还是其他的数据库错误.
select 'ifexist' from testformat;
then check the value of sqlcode,if sqlcode=942 it means the table is not exist.
通常会直接运行create table,如果出错,就,如果不出错,就。两种办法。:)