oracle mybatis一次执行多条sql,提示SQL命令未正确结束 5C

每条sql结尾带分号就报同样错误,单条sql的也是,不单是insert,该问题不针对insert

### The error occurred while setting parameters
### SQL: alter session force parallel query parallel 8;select * from c_tbtranslateconfig where intdel=0;alter session disable parallel query;
### Cause: java.sql.SQLSyntaxErrorException: ORA-00933: SQL 命令未正确结束
mybaits: mybatis-spring-boot-starter:1.3.2
oracle驱动包:com.oracle.ojdbc6:11.2.0.4

1个回答

mybatis+Oracle好像不支持多条语句,识别不了分号,不过你这个需求可以通过在Oracle创建存储过程或者函数实现

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
oracle执行后提示SQL命令未正确结束
oracle数据库表IPTONUM中定义strIP为VARCHAR2类型,大小为20,里面存储的是点分十进制IP地址,比如127.0.0.1。rnrn表中IP地址与整数一一对应,定义函数实现输入IP地址输出对应的整数:rn strSql.Format("select * from IPTONUM where STRIP = %s",strIP); rn BSTR bstrSQL = strSql.AllocSysString ();rn db.m_pRecordset->Open(bstrSQL,(IDispatch*) db.m_pConnection,adOpenDynamic,adLockOptimistic,adCmdText);rn rn while (!db.m_pRecordset->adoEOF)rn rn TheValue = db.m_pRecordset->Fields->GetItem("NUM")->Value;rn if(TheValue.vt!=VT_NULL)rn rn cstring = (char*)_bstr_t(TheValue);rn num=cstring;rn rn db.m_pRecordset->MoveNext();rn rn db.m_pRecordset->Close();rn rn catch(_com_error e)rn rn AfxMessageBox(e.Description());rn rn return num;rnrnrn运行时,总是提示SQL命令未正确结束,请问是什么原因?跟IP地址的点分十进制格式有关吗?
为啥提示 SQL 命令未正确结束?
[code=vb] Dim cmd As New OracleCommandrn cmd.CommandText = "select * from Biao1 where JBSJ=2013/6/21 21:39:13rn cmd.Connection = OrclConnrn cmd.CommandType = CommandType.Textrn Dim OrclAdp As New OracleDataAdapterrn OrclAdp.SelectCommand = cmdrn Dim ds As New DataSetrn Tryrn OrclAdp.Fill(ds, TableName)rn Catch ex As Exceptionrn MsgBox(ex.Message)rn Return Nothingrn End Try[/code]rn其中JBSJ是Biao1中date类型的字段,执行时提示: SQL 命令未正确结束?rn是怎么回事,如何解决? 连接的是oracle数据库
Oracle 报错sql命令未正确结束
![图片说明](https://img-ask.csdn.net/upload/201903/13/1552462543_940273.png)rnrn![图片说明](https://img-ask.csdn.net/upload/201903/13/1552462772_633183.png)rn把代码放到plsql能正常执行
【ORACLE】ORA-00933 sql 命令未正确结束
sql语句(或者代码中的sql语句)写的问题
SQL命令未正确结束
pl_bgndate varchar2(20);rnpl_enddate varchar2(20);rnpl_tables varchar2(2000);rnpl_str varchar2(1000);rnbeginrn pl_bgndate:=to_char(:pl_bgndate,'yyyy-mm-dd');rn pl_enddate:=to_char(:pl_enddate,'yyyy-mm-dd');rn pl_tables:=gettables('tsalsale',pl_bgndate,pl_enddate);rn pl_str:='select a.chcode,count(a.chcode) num,b.empname,sum(a.ssl) ssl from '||pl_tables||' a,tUsrEmployee b where a.tran=1 and a.orcode=6 and a.chcode=b.empcode and to_char(a.jzd,''yyyy-mm-dd'') between '''||pl_bgndate||''' and '''||pl_enddate||''' group by a.chcode,b.empname order by a.chcode';rnend;rn各位帮看看为什么执行时提示SQL命令未正确结束?
SQL 命令未正确结束
if Request("action")="del" thenrnrn Set rs = Server.CreateObject("ADODB.Recordset") rn Sql="Select * from slaver where time="& Request("time")rn rs.Open Sql,conn,1,3 ***** rn rs.delete rn rs.closern set rs=nothingrnend if rn----------------------------------------------------------rnOraOLEDB 错误 '80004005' rnrnORA-00933: SQL 命令未正确结束rnrn*****为出现错误行 [img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/001/face/35.gif][/img]rn
SQL 命令未正确结束!
我用的是J2EE,3大框架整合,不管我登陆时候输入什么账号密码 统统报错,数据库是oracle的 如下:rnrn*******************UsersDaoImpl中的map值为:userName=sadf, userState=未锁定, userPass=sadf rn******************from Users as u where 1=1 and u.userName='sadf' and u.userState='未锁定' and u.userPass='sadf' rn2009-03-03 18:27:23 [org.hibernate.util.JDBCExceptionReporter]-[ERROR] ORA-00933: SQL 命令未正确结束rnrnrn
sql命令未正确结束
[code=C/C++]CDatabase m_db;rn CRecordset rs; rn rs.m_pDatabase = &m_db; rn CString strConnect; rnrn CTime time;rn CString strTime;rn time=CTime::GetCurrentTime();rn strTime=time.Format(_T("%Y-%m-%d %H:%M:%S"));rnrn strConnect.Format(_T("DSN=%s;UID=%s;PWD=%s"),m_login_origin,m_login_name,m_login_pwd); rnrn m_db.OpenEx(strConnect,CDatabase::noOdbcDialog); rn CString sqlflat =_T("");rn sqlflat.Format(_T("Update ALARM SET SEND_FLAG=1 Where ALARM_ID=%d"),m_alarm_id);rn m_db.ExecuteSQL(sqlflat);rn CString sqltime =_T("");rn sqltime.Format(_T("Update ALARM SET OPERATE_TIME=%s Where ALARM_ID=%d"),strTime,m_alarm_id);//到这就出错了 不知道为什么rn m_db.ExecuteSQL(sqltime);[/code]rn错误提示sql命令未正确结束,大侠帮忙
mybatis 一次执行多条SQL
Xml代码   insert id="insertUser" parameterType="com.test.model.User">            insert into user (id,email,name,phone,status) values(#{id,jdbcType=INTEGER},#{email,jdbcType=VARCHAR},#{nick,jdbc
mybatis一次执行多条SQL
如题,mybatis如何一次执行多条SQL语句,例如update节点,如何同时更新多张表,执行多条SQL语句。
执行sql语句提示ORA-00933:sql语句未正确结束
我在执行sql语句的时候提示ORA-00933:sql语句未正确结束。代码如下“rnprotected void Page_Load(object sender, EventArgs e)rn rn if (!IsPostBack)rn rn MainID.Value = Request.QueryString["REAGENTID"];rn //Response.Write(MainID.Value);rn if (string.IsNullOrEmpty(MainID.Value))rn MainID.Value = "0";rnrn SQLBase h = new SQLBase();rn DBParameterCollection pc = new DBParameterCollection();rn pc.Add(pcPageParams.GetDBParameter("id"));rn DataTable dt = h.ExecuteDataTable("SELECT * FROM SJ_INFORMATION Where REAGENTID = :id", pc);rn rn //将查询到的数据填充到输入控件中rn pcPageParams.SetValue(dt);rn if (string.IsNullOrEmpty(MainID.Value))rn MainID.Value = "0";rn rn msg.Value = "";rn rnrn protected void save_Click(object sender, EventArgs e)rn rn SQLBase sb = new SQLBase();rn sb.Begin(true);rn tryrn rn string sql = "";rnrn if (MainID.Value == "0")rn rn sql = @"insert into SJ_INFORMATION(REAGENTNAME,REAGENTNAMEPYM,REAGENTSPEC,NOTUSE,REAGENTTXM,MANUFACTURER,UPSTOCKPILE,LOWSTOCKPILE,PASSNUMBER,EFFECTIVEDATE)VALUES('" + REAGENTNAME.Text + "','" + REAGENTNAMEPYM.Text + "','" + REAGENTSPEC.Text + "','" + NOTUSE.Text + "','" + REAGENTTXM.Text + "','" + MANUFACTURER.Text + "','" + UPSTOCKPILE.Text + "','" + LOWSTOCKPILE.Text + "','" + PASSNUMBER.Text + "','" + EFFECTIVEDATE.Text + "')";rnrn MainID.Value = PubGlobal.GetPrimaryID(sb, "SJ_INFORMATION").ToString();rn rn elsern rn sql = @"UPDATE SJ_INFORMATION SET REAGENTNAME ='" + REAGENTNAME.Text + "', REAGENTNAMEPYM = '" + REAGENTNAMEPYM.Text + "', REAGENTSPEC = '" + REAGENTSPEC.Text + "', NOTUSE = '" + NOTUSE.Text + "', REAGENTTXM = '" + REAGENTTXM.Text + "', MANUFACTURER = '" + MANUFACTURER.Text + "' UPSTOCKPILE = '" + UPSTOCKPILE.Text + "', LOWSTOCKPILE = '" + LOWSTOCKPILE.Text + "', PASSNUMBER = '" + PASSNUMBER.Text + "',EFFECTIVEDATE ='" + EFFECTIVEDATE.Text + "' where REAGENTID ='"+ MainID .Value +"'";rn rnrn DBParameterCollection pc = new DBParameterCollection();rnrn sb.ExecuteNonQuery(sql, pc);rnrn sb.Commit();rnrn msg.Value = "OK";rnrn Response.Redirect("ReagentInformationlist.aspx");rn rn catchrn rn sb.Rollback();rn throw;rn rn rnrn高手们帮我看看、检查下。在线等消息··
Oracle 命令未正确结束
在PLSQL中执行: select * from company left join Department on company.departmentid=Department.Departmentidrn提示命令未正确结束
急!在线等!!!ORA-00933: SQL 命令未正确结束 java.sql.SQLException: ORA-00933: SQL 命令未正确结束
如何解决,是什么问题?rn
ORA-00933: SQL 命令未正确结束 java.sql.SQLException: ORA-00933: SQL 命令未正确结束
是什么原因?rnrn急,在线等
ORA-00933: SQL 命令未正确结束
java.sql.SQLSyntaxErrorException: ORA-00933: SQL 命令未正确结束 在数据库中语句运行完全没问题,但是在编程的时候却报这样的错误 控制台看似报一大堆异常原因可能是:1、你没逗号可能没写够,仔细检查SQL语句 2、在写jdbc操作时,在进行多表关联查询时,我们通常采用分行的写法,但是需要注意在每行sql语句结束后与冒号之间加个空格。如图 ps:你们...
为什么说SQL命令未正确结束?
代码如下rnselect c.idcard,name,age,addressrnfrom t_customer c,t_branch b,t_account arngroup by b.branch_codernwhere c.idcard = a.cust_idcard and b.branch_code = a.branch_code and branch_city = '福州';rn运行就提示第四行SQL命令未正确结束rn如果去掉一些改成下面就可以但是不是我要的结果...rnselect c.idcard,name,age,addressrnfrom t_customer c,t_branch b,t_account arnwhere c.idcard = a.cust_idcard and b.branch_code = a.branch_code;rnrn求解
ORA-00933: SQL 命令未正确结束???
在jsp页面中的textarea加入从word文档copy来的文章。提交给oracle是就出现上面所说的错误rn。不知是不是word里的某些字符造成sql解释不正确呢???。rn 如果是自己打的。或者是copy网页上的就成功。rn急!!!!!!!!!!
ORA-00933:SQL 命令未正确结束(1)
  项目中mysql数据库换oracle数据库中报ORA-00933:SQL 命令未正确结束 问题   1、报错:ORA-00933:SQL 命令未正确结束 2、解决方法:将图1中的limit分页改成图2中的写法 图1: 图2: ...
急~~~~~~~~~~~~~~~~~~~"SQL命令未正确结束"为什么????
update tongji set tongji.a=DQJB.J1 from tongji,DQJB where tongji.xh=DQJB.xhrnrn想把DQJB表中相关数据导入tongji表
ORA-00933:SQL命令未正确结束 ?
[code=SQL]update fk_resource rnset grade_path=(select a.grade_path from fk_resource a where a.id=fk_resource.father_id) || '/' || cast(id as varchar2(10)) rnwhere father_id<>-1[/code]rnrn这条sql语句报ORA-00933:SQL命令未正确结束rn看不出来哪里错了,谁能帮个忙解决一下,非常感谢!
sql命令未正确结束问题
我的VB程序有以下代码rn strSQL = " SELECT * FROM signup " _rn & " WHERE year = " & cmbYear.Text & " AND cmbissue = '" & cmbIssue.Text & "' "rn OracleIsExist gManager.gconSignUp, gManager.gOraSignUprn Set tRst = gManager.gconSignUp.Execute(strSQL, , adCmdText)rn rn If tRst.RecordCount < 1 Thenrn ——————————rn运行后出现ora-00933 sql命令未正确结束问题 请问怎么解~~~~
ORA-00933: SQL 命令未正确结束(2)
  项目中mysql数据库换oracle数据库中报ORA-00933:SQL 命令未正确结束 问题   1、报错:ORA-00933:SQL 命令未正确结束 2、解决方法,将图1中表的别名as 去掉,如图2.    ...
ORA-00933: SQL 命令未正确结束(3)
  项目中mysql数据库换oracle数据库中报ORA-00933:SQL 命令未正确结束 问题   1、报错如下图: 2、mybatis中的sql如下图: 3、解决方法如下图:
hibernate报错SQL 命令未正确结束
初学hibernate,只有一张表,数据库用的Oracle11g,hibernate用的5.2.10;rnrn实体类的配置文件如下,主键为自动增长,表中没有设置序列rnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrnhibernate的主配置如下:rnrn rn rn oracle.jdbc.driver.OracleDriverrn rn javarn rn jdbc:oracle:thin:@localhost:1521:orclrn rn OFSEVENrn rn OFSEVENrn rn OFSEVENrn rn org.hibernate.dialect.Oracle10gDialectrn falsern rn rn truern rn truern rn rn rnrnrn然后每次保存数据时总是报错rn public static void main(String[] args) rn try rn //获得一个数据库会话对象rn Session session = HibernateSessionFactory.getSession();rn //创建实体类rn Student stu = new Student("小柴", "男", 2);rn //开启事物rn Transaction tx = session.beginTransaction();rn session.save(stu);rn tx.commit();rn catch (Exception e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn finally rn HibernateSessionFactory.closeSession();rn rn rnrn报错如下:rn[color=#FF0000]四月 19, 2017 1:06:46 上午 org.hibernate.envers.boot.internal.EnversServiceImpl configurernINFO: Envers integration enabled? : truernHibernate: rn selectrn max(STUID) rn fromrn OFSEVEN.OFSEVEN.STUDENTrn四月 19, 2017 1:06:47 上午 org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptionsrnWARN: SQL Error: 933, SQLState: 42000rn四月 19, 2017 1:06:47 上午 org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptionsrnERROR: ORA-00933: SQL 命令未正确结束rnrnorg.hibernate.exception.SQLGrammarException: could not extract ResultSet[/color]rnrn求救!!!
ORA-00933: SQL 命令未正确结束,求解
public User findUserByNameAndPassworf(String name, String password) rn try rn conn=ConnectionFactory.getConnection();rn System.out.println(conn);rn StringBuffer sql=new StringBuffer();rn sql.append("select id,name,password from tb_user");rn sql.append("where name=? and password=?");rn pstm=conn.prepareStatement(sql.toString());rn pstm.setString(1, name);rn pstm.setString(2, password); rn rs=pstm.executeQuery();rn User user=null;rn if(rs.next())rn rn user= new User();rn user.setId(rs.getInt("id"));rn user.setName(rs.getString("name"));rn user.setPassword(rs.getString("password"));rn System.out.println(user.getPassword());rn rn rn return user;rn catch (Exception e) rn rn e.printStackTrace();rn return null;rn finallyrn ConnectionFactory.close(conn, pstm, rs);rn rnrn rn rn注释掉sql.append("where name=? and password=?");rn pstm.setString(1, name);rn pstm.setString(2, password); rn
关于mybatis一次执行多条sql的问题
1.使用mysql 网上很多帖子 2.使用oracle 我使用的springboot,虽然druid开启了一次执行多条sql,但是orcle一直报错ORA-00911: 无效字符, 大部分帖子说是多了分号的原因,但是执行多条语句分号必须有存在,这就矛盾了   暂无解决办法,貌似mybatis和oracle不能这样用,如果哪位朋友知道,请指点一下,感激不尽 附上springboot数据...
mybatis一次执行多条SQL语句
mybatis一次执行多条delete语句
mybatis一次请求执行多条sql
因为项目需要,需要在mybatis同个标签中执行多条sql语句。如下: insert into user (id,email,name,phone,status) values(#{id,jdbcType=INTEGER},#{email,jdbcType=VARCHAR},#{nick,jdbcType=VARCHAR},#{phone,jdbcType=VARCHAR
MyBatis 一次执行多条SQL语句
在实际工作会遇到什么情况下,需要在MyBatis中一次执行多条语句,那应该怎么处理呢?(此处使用MySql数据库) 1、修改数据库连接参数加上allowMultiQueries=true,如:jdbc_url=jdbc:mysql://111.111.111.111:3306/test?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBeha
设置允许mybatis一次执行多条sql
jdbc连接增加allowMultiQueries=true即可jdbc.jdbcUrl=jdbc:mysql://127.0.0.1:3306/database?useUnicode=true&characterEncoding=utf8&allowMultiQueries=truesql之间使用;分隔demo<update id="down"> UPDATE table SET
MyBatis一次执行多条SQL语句
有个常见的场景:删除用户的时候需要先删除用户的外键关联数据,否则会触发规则报错。 解决办法不外乎有三个:1、多条sql分批执行;2、存储过程或函数调用;3、sql批量执行。 今天我要说的是MyBatis中如何一次执行多条语句(使用mysql数据库)。 1、修改数据库连接参数加上allowMultiQueries=true,如: class="org.springframework.jdbc.
MyBatis一次执行多条SQL语句配置
需要在数据库连接参数加上allowMultiQueries=true
mybatis一次执行多条sql语句
写法: BEGIN UPDATE TABLE_A SET NAME='ABC' WHERE ID ='123'; UPDATE TABLE_B SET NAME='DEF' WHERE ID ='456'; END;若是多条数据,可以使用foreach循环;
Mybatis批量添加:报错信息:ORA-00933: SQL 命令未正确结束
Mybatis里面:n nn insert into USER_ROLE_AUTn (RU_ID, RU_ROLE_ID, RU_AUT_ID, RU_TIME_INS, RU_USER_INS, RU_TIME_LST, RU_USER_LST, RU_STATUS) n select U.* from USER_ROLE_AUTn ( n selectn RU_ID_SEQ.Nextval,n #item.ruRoleId,jdbcType=DECIMAL, n #item.ruAutId,jdbcType=DECIMAL, n #item.ruTimeIns,jdbcType=TIMESTAMP, n #item.ruUserIns,jdbcType=VARCHAR, n #item.ruTimeLst,jdbcType=TIMESTAMP, n #item.ruUserLst,jdbcType=VARCHAR,n #item.ruStatus,jdbcType=CHARn from USER_ROLE_AUTn n )Un n n action里面:n @RequestMapping("roleAutSave")n @ResponseBodyn public Map roleAutSave(HttpServletRequest request, HttpSession session)n throws SystemException n Map rtnmap = null;n Map map = new HashMap();n try n String ruAutId = request.getParameter("ruAutId");// 获取到树形菜单选中的节点n System.out.println(ruAutId);n String[] adeArrs = ruAutId.split(",");n System.out.println(adeArrs);n String ruRoleId = request.getParameter("ruRoleId");// 获取选中的角色idn String ruUserIns = request.getParameter("ruUserIns");// 获取登录的账号n List ls = new ArrayList();n UserRoleAut ur = null;n for (String ade : adeArrs) n ur = new UserRoleAut();n ur.setRuRoleId(new Long(ruRoleId));n ur.setRuAutId(new Long(ade));n ur.setRuUserIns(ruUserIns);n ls.add(ur);n n map.put("maps", ls);n userRoleAutMapper.insert(map);// 保存n userRoleAutMapper.deleteByPrimaryKey();n rtnmap = okMap("roleAut");n catch (Exception e) n rtnmap = failMap("roleAut");n e.printStackTrace();n n return rtnmap;n
命令未正确结束
select t.deptname,t.professionalname,t.name,t.score from BK t where 1=1 AND department = 2bbde1c0-7973-4d2e-8a55-2f101b41c1d6 AND specialty =66dd43a4-b310-49e0-bb98-b101320d7e8c AND MONTH between 1 and 12 ORDER BY SCORE DESC 命令未正确结束是怎么回事
命令未正确结束.......
我在source里 拼接了一段sql文rn内容如下:rnUPDATE S_46DISPLAY SET PREVENTIONHEATSTS = '02' WHERE OFFICE_CD = ‘7200’rnrn在oracle中测试没有问题。rn但是通过程序调用怎么就会报出 00933:命令未正确结束的错误呢?rnrn望高手能指点指点。。
mybatis 一次执行多条
jdbc.jdbcUrl=jdbc:mysql://127.0.0.1:3306/database?useUnicode=true&amp;amp;characterEncoding=utf8&amp;amp;allowMultiQueries=true 加了参数后,我又将mybatis配置文件改了回去,测试一下,执行成功。...
Oracle报ORA-00933:SQL 命令未正确结束
出现这种情况的原因: 使用了含有ORDER BY或INNER JOIN子句的INSERT、DELETE语句 使用了含有INNER JOIN子句的UPDATE语句 使用了条件中含有自连接表字段比较的Triangular Join  解决方案:     在两句sql中,每句以英文的逗号分隔即可。 ...
很着急Oracle 语句错误 ORA-00933: SQL 命令未正确结束
select ua.*,ub.COMMENTS as comm from USER_TAB_COLUMNS as ua ,USER_COL_COMMENTS as ub where ua.table_name=ub.table_name and ub.table_name='BB_BB'rnrn到底是哪里错了啊!rn谢谢!
相关热词 c++和c#哪个就业率高 c# 批量动态创建控件 c# 模块和程序集的区别 c# gmap 截图 c# 验证码图片生成类 c# 再次尝试 连接失败 c#开发编写规范 c# 压缩图片好麻烦 c#计算数组中的平均值 c#获取路由参数