Commit 后仍然无法插入到表中,高手来看一下!!!在线
我想将表C01D中满足条件的数据插入到临时表TempC01d中,语法没错!
在程序和数据库中单独执行
SELECT *
FROM c01d
WHERE c01d00=:ll_soucestorenum AND c01d09=:ll_soucegys;
也能有结果
帮忙看一下其他地方有什么问题
sqlca.autocommit=false,
表TempC01d 有主键,
使用PB9.0+Oracle 8
代码如下:
//检查临时表中是否有数据,有则删除后插入,无则直接插入
int tempcount
SELECT count(*)
INTO :tempcount
FROM tempc01d;
if tempcount>0 then
DELETE *
FROM TempC01d;
Commit;
if sqlca.sqlcode<>0 then
messagebox("DELETE",sqlca.sqlerrtext) /////运行是无提示!
end if
INSERT INTO tempc01d
VALUES
SELECT *
FROM c01d
WHERE c01d00=:ll_soucestorenum AND c01d09=:ll_soucegys;
COMMIT;
////这是在测试时加的,运行时无提示
if sqlca.sqlcode<>0 then
messagebox("INSERT",sqlca.sqlerrtext)
end if
SELECT count(*)
into :tempcount
FROM c01d ;
INSERT INTO tempc01d
SELECT *
FROM c01d
WHERE c01d00=:ll_soucestorenum AND c01d09=:ll_soucegys;
COMMIT;
////这是在测试时加的,运行时无提示
if sqlca.sqlcode<>0 then
messagebox("INSERT",sqlca.sqlnrows)
end if
SELECT count(*)
into :tempcount
FROM c01d ;
messagebox("SECOND_count",string(tempcount))//查询返回为0条记录,在数据库中也无记录
看遍了论坛里的帖子,也没有这种情况的解决方法,只好烦请各位高手帮忙了,不胜感激!!!!
先谢谢了