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个回答

 select LAST_INSERT_ID()这个是mysql
 oracle是  SELECT SEQ_MC_MEMB.CURRVAL  AS VALUE FROM DUAL 
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐