Oo烟花火 发表于 2012-06-14 15:26

程序中INSERT语句带to_char(sysdate, '%Y-%m-%d %H:%M:%S'))之类的就会报错

程序中INSERT语句带to_char(sysdate, '%Y-%m-%d %H:%M:%S'))之类的就会报错,to_char(current, '%Y-%m-%d %H:%M:%S'))也会报错,但是在客户端中改语句却可以正常执行,不知道什么原因,求大侠解释:

报错信息如下:

Schedcfg.cpp line 880 SchedulerConfig::insertTaskLog(int, int, int, int, string &, int, int, string &): 数据库访问失败:ErrSQL:【insert into TSCH_TASK_LOG (TASK_INS_ID,TASK_ID,SCHE_ID,DATASOURCEID,BUSINESS_TYPE,BATCHCOUNT,STATE,EXEC_TIME,BEGINDATE)values (            ?,      ?,         ?,         ?,            ?,      ?,      ?,         ?,to_char(sysdate, '%Y-%m-%d %H:%M:%S'))】 ErrMsg:【VALUES clause may not have expressions if a cursor is declared on an INSERT.
ErrCode=-938 ISAM:0】

错误码的对应解释:

-938    VALUES clause may not have expressions if a cursor is declared
on an INSERT.

The INSERT statement to be associated with the INSERT cursor includes
a VALUES clause that has one or more expressions.

Change the application so that expressions are not used in the
VALUES clause.

3sane 发表于 2012-06-18 15:07

回复 1# Oo烟花火

cursor不支持函数,试试insert into xxx select ... from table(set{1})
页: [1]
查看完整版本: 程序中INSERT语句带to_char(sysdate, '%Y-%m-%d %H:%M:%S'))之类的就会报错