动态游标不能正确执行 + 不能检测数据库中是否已经存在了某个表????
一,动态检测某个数据库表的记录数是否为零(数据库表不确定)
string table_temp //动态的数据库表名
int count_temp //
string sql_temp //动态sql语句
sql_temp = "select count(*) from " + table_temp
declare get_count cursor for sql_temp;
open get_count;
fetch get_count into :count_temp;
close get_count;
if count_temp = 0 then
//...
end if
无论怎么样
最后提取的count_temp都是0
二,不能检测数据库中是否已经存在了某个表
select count(*)
into :count_temp
from sysobjects
where name = :table_temp;
最后得到也总是0
就是检测不到记录数
不知道为什么
我都一年没有摸pb了
请各位帮忙
:P
柿子