当前位置: 代码迷 >> J2SE >> 求高手指教啊不知咋错的啊解决方法
  详细解决方案

求高手指教啊不知咋错的啊解决方法

热度:185   发布时间:2016-04-24 02:24:33.0
求高手指教啊,不知咋错的啊
Java code
sql = " set nocount on "+                        " declare @maxid varchar(20), @maxno varchar(10),@maxpk varchar(20) " +                        " exec GetSequence_bs 'ProjectMain',6, @maxid out "+                        " exec GetSequence_bs 'sys_gcjl',6, @maxpk out "+                        " exec GetSequence_bs 'ProjectMain_"+fc.gettoday().substring(0,4)+ townNo +"',3, @maxno out set "+                         " update projectMain set data_ip = subString(data_ip,1,1)+ '1' + subString(data_ip,3,38),Pcode='P"+Constants.SYSTEM_NO_TYPE +"'+@maxid,'"+Str_no+"'+@maxno"+                        "where id ='"+ gc_id +"'" ;



错误如下:
sql= set nocount on declare @maxid varchar(20), @maxno varchar(10),@maxpk varchar(20) exec GetSequence_bs 'ProjectMain',6, @maxid out exec GetSequence_bs 'sys_gcjl',6, @maxpk out exec GetSequence_bs 'ProjectMain_201134',3, @maxno out set update projectMain set data_ip = subString(data_ip,1,1)+ '1' + subString(data_ip,3,38),Pcode='PZJ'+@maxid,'ZJF201134'+@maxnowhere id ='PZJ002926'
java.sql.SQLException: 第 1 行: 'ZJF201134' 附近有语法错误。
at net.sourceforge.jtds.jdbc.SqlMessage.toSQLException(SqlMessage.java:392)
at net.sourceforge.jtds.jdbc.SQLWarningChain.addOrReturn(SQLWarningChain.java:91)
at net.sourceforge.jtds.jdbc.Tds.goToNextResult(Tds.java:750)
at net.sourceforge.jtds.jdbc.TdsStatement.getMoreResults(TdsStatement.java:710)
at net.sourceforge.jtds.jdbc.TdsStatement.executeImpl(TdsStatement.java:276)
at net.sourceforge.jtds.jdbc.TdsStatement.internalExecute(TdsStatement.java:244)
at net.sourceforge.jtds.jdbc.TdsStatement.internalExecute(TdsStatement.java:233)
at net.sourceforge.jtds.jdbc.TdsStatement.executeQuery(TdsStatement.java:205)
at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:205)
at db.ProjectDB.savaSl(ProjectDB.java:1009)
at actions.gcjd.ProjectMainAction.execute(ProjectMainAction.java:234)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at com.sbdcpn.utils.filters.SetCharacterEncodingFilter.doFilter(Unknown Source:81)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at base.FileUploadFilter.doFilter(FileUploadFilter.java:67)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:257)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
  相关解决方案