qq_22701921
指尖1993
采纳率46.7%
2017-01-17 02:27

mybaitis插入返回主键的时候报错,显示ORA-00923:

sql语句:

 <insert id="insert" parameterType="com.zbiti.itop.complain.entity.Complain">
        <![CDATA[
            insert into MSS_FAULT
            (mf_id,mf_Sys_Type,mf_Major,mf_Detail)
            values (SEQ_MSS_FAULT.nextval,#{mfSysType},#{mfMajor},#{mfDetail})
        ]]>

        <selectKey order="AFTER" keyProperty="mfId" resultType="java.lang.String">  

            select LAST_INSERT_ID()
        </selectKey>  
    </insert>

下面是报错:

 2017-01-17 10:19:35.935 [http-bio-8080-exec-8] DEBUG com.zbiti.base.spring.EmossExceptionHandler(133) - Resolving exception from handler [public void com.zbiti.itop.complain.controller.ComplainController.add(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) throws java.lang.Exception]: org.apache.ibatis.exceptions.PersistenceException: 
### Error updating database.  Cause: org.apache.ibatis.executor.ExecutorException: Error selecting key or setting result to parameter object. Cause: java.sql.SQLSyntaxErrorException: ORA-00923: 未找到要求的 FROM 关键字
Caused by: org.apache.ibatis.executor.ExecutorException: Error selecting key or setting result to parameter object. Cause: java.sql.SQLSyntaxErrorException: ORA-00923: 未找到要求的 FROM 关键字


set get 方法也都提供了,请问这个是怎么回事儿?谢谢

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • JE_GE JE_GE 4年前
     select LAST_INSERT_ID()这个是mysql
     oracle是  SELECT SEQ_MC_MEMB.CURRVAL  AS VALUE FROM DUAL 
    
    点赞 1 评论 复制链接分享

相关推荐