Sybase- Incorrect syntax near '2008'.

报错如下:

java.lang.Exception: {Ams}org.springframework.jdbc.BadSqlGrammarException: SqlMapClient operation; bad SQL grammar []; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:  
--- The error occurred while applying a parameter map. 
--- Check the ycHdexamine.getOrderYchdByPage-InlineParameterMap. 
--- Check the statement (update procedure failed). 
--- Cause: com.sybase.jdbc3.jdbc.SybSQLException: Incorrect syntax near '2008'.

Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:  
--- The error occurred while applying a parameter map. 
--- Check the ycHdexamine.getOrderYchdByPage-InlineParameterMap. 
--- Check the statement (update procedure failed). 
--- Cause: com.sybase.jdbc3.jdbc.SybSQLException: Incorrect syntax near '2008'.

 

错误中的2008应该是指页面中的时间:

 

控制台sql的执行输出:

 { call ams_query_page (  ' select aa.* from (    select workid workId,    orgrowid,    orgName,    objectNo,    objectName,    objectRowid,    userNo,    userRowId,    userName,    measurepointId    ,measurepointrowId,    measurepointName,    alarmType,    zdType,    alagf,     dateData,    ischeck,    dataValue,    remark   from order_ychd where alarmType = 1   and dateData >=  '2008-09-19'     and dateData <  '2013-09-25'    ) aa ' ,0 , 50 ) }    ;红色部分是当参数传进来的,所以里面的两个日期要用双引号。 

 

而改为双引号重启服务器之后,又报另一个错:Caused by: com.sybase.jdbc3.jdbc.SybSQLException: Invalid column name '2013-09-25'.    ;

请看Sybase-Invalid column name '2013-09-25'.

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值