免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1839 | 回复: 4
打印 上一主题 下一主题

如何知道语句执行成功与否? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-03-30 09:51 |只看该作者 |倒序浏览
我的系统是NT4.0、IDS7.3
我用select dbinfo('sqlca.sqlcode') from systables where tabid=1;它老是报错提示‘Unknown first argument of dbinfo('sqlca.sqlcode')’,那该怎么用?谢谢了

论坛徽章:
0
2 [报告]
发表于 2006-03-30 10:30 |只看该作者
dbinfo 的参数 是有限制的。

DBINFO ('dbhostname')
DBINFO ('version', 'server-type')
DBINFO ('version', 'major')
DBINFO ('version', 'minor')
DBINFO ('version', 'os')
DBINFO ('version', 'level')
DBINFO ('version', 'full')
DBINFO ('utc_to_datetime',
DBINFO ('utc_current')
DBINFO ('get_tz')
DBINFO ('sessionid')
DBINFO ('dbspace',
DBINFO ('sqlca.sqlerrd1')
DBINFO ('sqlca.sqlerrd2')

论坛徽章:
0
3 [报告]
发表于 2006-03-30 10:46 |只看该作者

论坛徽章:
0
4 [报告]
发表于 2006-03-30 16:02 |只看该作者
谢谢,我用DBINFO ('sqlca.sqlerrd2') 时有这样的情况
select * from operater  //实际有120条
用DBINFO ('sqlca.sqlerrd2') 显示1
select * from operater where code_dep='0001' //实际有20条
用DBINFO ('sqlca.sqlerrd2') 显示20

不知何故?

论坛徽章:
0
5 [报告]
发表于 2006-03-30 16:29 |只看该作者
from iiug faq

6.13 Is the number of rows processed in the SQLERRD structure accurate?
... or is it just an estimate?

The info in the SQLERRD item is only filled in after you've processed the last row. It therefore isn't much help in the context of SELECT.

It is very useful in the context of:

DELETE FROM Table WHERE ...
UPDATE Table SET .... WHERE ...
INSERT INTO Table SELECT ...
SELECT .... INTO TEMP Table
In all cases, it is an exact number.

With the more recent Engines, the estimates of the cost and number of rows to be returned are also available. For more information look in the Informix Guide to SQL Reference Manuals under 'Error checking with SQLCA' (or under 6.0, the individual ESQL manuals).
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP