frank_liu 发表于 2010-7-9 10:42:55

测试sql语句,报“ORA-24333: 零迭代计数”错误

LR9.5+oracle 10g,直接使用脚本连接数据库和进行INSERT操作,脚本如下:
--------------------------我是脚本-Begin-------------------------------------------
vuser_init()
{
        lrd_init(&InitInfo, DBTypeVersion);
        lrd_initialize_db(LRD_DBTYPE_ORACLE, 3, 0);
        lrd_env_init(LRD_DBTYPE_ORACLE, &OraEnv1, 0, 0);
        lrd_ora8_handle_alloc(OraEnv1, SVCCTX, &OraSvc1, 0);
        lrd_ora8_handle_alloc(OraEnv1, SERVER, &OraSrv1, 0);
        lrd_ora8_handle_alloc(OraEnv1, SESSION, &OraSes1, 0);
        lrd_server_attach(OraSrv1, "*****", 10, 0, 0);
        lrd_ora8_attr_set_from_handle(OraSvc1, SERVER, OraSrv1, 0, 0);
        lrd_ora8_attr_set_from_handle(OraSvc1, SESSION, OraSes1, 0, 0);
        lrd_ora8_attr_set(OraSes1, USERNAME, "****", -1, 0);
        lrd_ora8_attr_set(OraSes1, PASSWORD, lr_decrypt("*******"), -1, 0);
         lrd_session_begin(OraSvc1, OraSes1, 1, 0, 0);
        lrd_ora8_handle_alloc(OraEnv1, STMT, &OraStm1, 0);

        return 0;
}
Action()
{
        lrd_ora8_stmt(OraStm1, "insert into test values(1,'test')\n", 1, 0, 0);
       
        lr_rendezvous("aaa");       
        lr_start_transaction("aaa");
        lrd_ora8_exec(OraSvc1, OraStm1, 0, 0, &uliRowsProcessed, 0, 0, 0, 0, 0);
         lr_end_transaction("aaa", LR_AUTO);
        return 0;
}
vuser_end()
{
    lrd_handle_free(&OraStm1, 0);
    lrd_session_end(OraSvc1, OraSes1, 0, 0);
    lrd_server_detach(OraSrv1, 0, 0);
    lrd_handle_free(&OraEnv1, 0);

        return 0;
}
-----------------------------我是脚本-END------------------------------------------------------

错误如下:Q :
-----------------------------我是错误-Begin----------------------------------------------------
Action.c(25): Error: lrdo_ora8_exec: "OCIStmtExecute" return-code=OCI_ERROR, error-code=24333:
Action.c(25): Error:   ORA-24333: 零迭代计数
Action.c(25): ora8_exec: ERROR, return-code=LRDE2009.0 row(s) processed
-----------------------------我是错误-END----------------------------------------------------

frank_liu 发表于 2010-7-9 10:55:47

搞定了!
:lol

zhuzhuzhi 发表于 2010-8-2 10:41:28

怎么解决的?

楼主,我在插入记录的时候遇到同样的问题了,请问楼主是如何解决的?谢谢

frank_liu 发表于 2010-8-3 17:11:32

lrd_ora8_exec(OraSvc1, OraStm1, 0, 0, &uliRowsProcessed, 0, 0, 0, 0, 0);
改成
lrd_ora8_exec(OraSvc1, OraStm1, 1, 0, &uliRowsProcessed, 0, 0, 0, 0,0);

goldfeng 发表于 2010-9-20 14:20:27

第三个参数:muliTotalRowsThe total number of rows in the placeholder arrays or the number of times to execute the statement for non-query statements
页: [1]
查看完整版本: 测试sql语句,报“ORA-24333: 零迭代计数”错误