免费注册 查看新帖 |

Chinaunix

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

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

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-06-14 15:26 |只看该作者 |倒序浏览
程序中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.

论坛徽章:
0
2 [报告]
发表于 2012-06-18 15:07 |只看该作者
回复 1# Oo烟花火

cursor不支持函数,试试insert into xxx select ... from table(set{1})
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP