<%
String deletesql="delete from selectedcource where stuSerial = "+stuSerial+"";
deletesql=deletesql+"and courseCode not in(select courseCode from (select s.*,(select count(*) from selectedcource where stuSerial = "+stuSerial+"";
deletesql=deletesql+"and courseCode = s.courseCode) isselected, (select openyear from selectedcource where stuserial = "+stuSerial+"";
deletesql=deletesql+"and courseCode=s.courseCode) openyear, (select isDegree from selectedcource where stuserial = "+stuSerial+"";
deletesql=deletesql+"and courseCode = s.courseCode) is_sel_degree from v_trainscheme s where schoolId='"+schoolId+"' and majorId='"+majorId+"' and stutypeid='"+stuType+"' and grade='"+grade+"' order by isdegree desc, typename))";
DB deletedb = new DB();
deletedb.executeQuery(deletesql);
%>出现错误:[08-3-7 16:43:09:062 CST] 5583a84a SystemOut O delete from selectedcource where stuSerial = 6241and courseCode not in(select courseCode from (select s.*,(select count(*) from selectedcource where stuSerial = 6241and courseCode = s.courseCode) isselected, (select openyear from selectedcource where stuserial = 6241and courseCode=s.courseCode) openyear, (select isDegree from selectedcource where stuserial = 6241and courseCode = s.courseCode) is_sel_degree from v_trainscheme s where schoolId='310' and majorId='050201' and stutypeid='02' and grade='2007' order by isdegree desc, typename))
[08-3-7 16:43:09:375 CST] 5583a84a WebGroup E SRVE0026E: [Servlet 错误]-[数据查询出错ORA-00900: 无效 SQL 语句
出错sql为:delete from selectedcource where stuSerial = 6241and courseCode not in(select courseCode from (select s.*,(select count(*) from selectedcource where stuSerial = 6241and courseCode = s.courseCode) isselected, (select openyear from selectedcource where stuserial = 6241and courseCode=s.courseCode) openyear, (select isDegree from selectedcource where stuserial = 6241and courseCode = s.courseCode) is_sel_degree from v_trainscheme s where schoolId='310' and majorId='050201' and stutypeid='02' and grade='2007' order by isdegree desc, typename))]:java.sql.SQLException: 数据查询出错ORA-00900: 无效 SQL 语句
出错sql为:delete from selectedcource where stuSerial = 6241and courseCode not in(select courseCode from (select s.*,(select count(*) from selectedcource where stuSerial = 6241and courseCode = s.courseCode) isselected, (select openyear from selectedcource where stuserial = 6241and courseCode=s.courseCode) openyear, (select isDegree from selectedcource where stuserial = 6241and courseCode = s.courseCode) is_sel_degree from v_trainscheme s where schoolId='310' and majorId='050201' and stutypeid='02' and grade='2007' order by isdegree desc, typename))
at util.db.DB.executeQuery(DB.java:47)
at org.apache.jsp._edit._jspService(_edit.java:323)
at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:357)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java:675)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:773)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:76)
at sys.secure.PageLoginFilter.doFilter(PageLoginFilter.java:40)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:132)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:71)
at servlet.SysFilter.doFilter(SysFilter.java:45)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:132)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:71)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:939)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:530)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:176)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:79)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:201)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:114)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:186)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:610)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:431)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:593)
String deletesql="delete from selectedcource where stuSerial = "+stuSerial+"";
deletesql=deletesql+"and courseCode not in(select courseCode from (select s.*,(select count(*) from selectedcource where stuSerial = "+stuSerial+"";
deletesql=deletesql+"and courseCode = s.courseCode) isselected, (select openyear from selectedcource where stuserial = "+stuSerial+"";
deletesql=deletesql+"and courseCode=s.courseCode) openyear, (select isDegree from selectedcource where stuserial = "+stuSerial+"";
deletesql=deletesql+"and courseCode = s.courseCode) is_sel_degree from v_trainscheme s where schoolId='"+schoolId+"' and majorId='"+majorId+"' and stutypeid='"+stuType+"' and grade='"+grade+"' order by isdegree desc, typename))";
DB deletedb = new DB();
deletedb.executeQuery(deletesql);
%>出现错误:[08-3-7 16:43:09:062 CST] 5583a84a SystemOut O delete from selectedcource where stuSerial = 6241and courseCode not in(select courseCode from (select s.*,(select count(*) from selectedcource where stuSerial = 6241and courseCode = s.courseCode) isselected, (select openyear from selectedcource where stuserial = 6241and courseCode=s.courseCode) openyear, (select isDegree from selectedcource where stuserial = 6241and courseCode = s.courseCode) is_sel_degree from v_trainscheme s where schoolId='310' and majorId='050201' and stutypeid='02' and grade='2007' order by isdegree desc, typename))
[08-3-7 16:43:09:375 CST] 5583a84a WebGroup E SRVE0026E: [Servlet 错误]-[数据查询出错ORA-00900: 无效 SQL 语句
出错sql为:delete from selectedcource where stuSerial = 6241and courseCode not in(select courseCode from (select s.*,(select count(*) from selectedcource where stuSerial = 6241and courseCode = s.courseCode) isselected, (select openyear from selectedcource where stuserial = 6241and courseCode=s.courseCode) openyear, (select isDegree from selectedcource where stuserial = 6241and courseCode = s.courseCode) is_sel_degree from v_trainscheme s where schoolId='310' and majorId='050201' and stutypeid='02' and grade='2007' order by isdegree desc, typename))]:java.sql.SQLException: 数据查询出错ORA-00900: 无效 SQL 语句
出错sql为:delete from selectedcource where stuSerial = 6241and courseCode not in(select courseCode from (select s.*,(select count(*) from selectedcource where stuSerial = 6241and courseCode = s.courseCode) isselected, (select openyear from selectedcource where stuserial = 6241and courseCode=s.courseCode) openyear, (select isDegree from selectedcource where stuserial = 6241and courseCode = s.courseCode) is_sel_degree from v_trainscheme s where schoolId='310' and majorId='050201' and stutypeid='02' and grade='2007' order by isdegree desc, typename))
at util.db.DB.executeQuery(DB.java:47)
at org.apache.jsp._edit._jspService(_edit.java:323)
at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:357)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java:675)
at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:773)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:76)
at sys.secure.PageLoginFilter.doFilter(PageLoginFilter.java:40)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:132)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:71)
at servlet.SysFilter.doFilter(SysFilter.java:45)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:132)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:71)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:939)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:530)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:176)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:79)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:201)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:114)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:186)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:610)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:431)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:593)
解决方案 »
- oracle9i导出的数据库文件怎么导入oracle10g中
- oracle group_concat运用,有兴趣请进
- 根据ER图写ORACLE SQL 语句
- 取前10行不用 rownum<=10 怎么取??
- 高手请进:Java中如何执行“show parameters;”这样的语句[在线等]
- 10g数据库启动错误提示:Io 异常: The Network Adapter could not establish the connection
- 关于在PL/SQL里对ORACLE数据库里的内容进行删除操作的简单问题(在线急等)
- bytes、blocks、extents是如何换算的???
- sql/plus中如何查询当前连接的数据库,类似 show user看用户一样
- mmp
- 一个workspace 能有多少个pc文件?
- 请帮忙看看这个触发器,高手进,问题解除有奖励哦!!!
deletesql=deletesql+"and courseCode not in(select courseCode from (select s.*,(select count(*) from selectedcource where stuSerial = "+stuSerial+"";
第二句看上去有问题
你这个s是在那定义的别名
另外介意输出整条sql,这样有利于找出sql的错误
delete from selectedcource where stuSerial = 6241 and courseCode not in(select courseCode from (select s.*,(select count(*) from selectedcource where stuSerial = 6241 and courseCode = s.courseCode) isselected, (select openyear from selectedcource where stuserial = 6241 and courseCode=s.courseCode) openyear, (select isDegree from selectedcource where stuserial = 6241 and courseCode = s.courseCode) is_sel_degree from v_trainscheme s where schoolId='310' and majorId='050201' and stutypeid='02' and grade='2007' order by isdegree desc, typename))
现在的问题是这个SQL在程序中执行了,数据得到了更新,但是现在出现"java.sql.SQLException: 数据查询出错ORA-00900: 无效 SQL 语句
"
写拼节的时候前后都加空格