Oracle Exceptions: Features not supported by the returning clause

Source: Internet
Author: User

Gets the exception that occurs when the sequence ID is checked to see if the Oracle database table ID field type is number type. If a long is modified to number. About number type: http://www.blogjava.net/caojianhua/archive/2011/01/24/343461.html severity:  nulljava.sql.sqlexception The: ora-22816: returning  clause does not support feature at oracle.jdbc.driver.sqlstatemapping.newsqlexception ( sqlstatemapping.java:70) at oracle.jdbc.driver.databaseerror.newsqlexception (DatabaseError.java:110) at  oracle.jdbc.driver.databaseerror.throwsqlexception (databaseerror.java:171) at  Oracle.jdbc.driver.T4CTTIoer.processError (t4cttioer.java:455) at oracle.jdbc.driver.t4cttioer.processerror (t4cttioer.java:413) at oracle.jdbc.driver.t4c8oall.receive (t4c8oall.java:1030) at  Oracle.jdbc.driver.T4CPreparedStatement.doOall8 (t4cpreparedstatement.java:194) at  Oracle.jdbc.driver.T4CPreparedStatement.executeForRows (t4cpreparedstatement.java:947) at  Oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout (oraclestatement.java:1222) at  Oracle.jdbc.driver.OraclePreparedStatement.executeInternal (oraclepreparedstatement.java:3381) At oracle.jdbc.driver.oraclepreparedstatement.executeupdate ( oraclepreparedstatement.java:3462) At oracle.jdbc.driver.oraclepreparedstatementwrapper.executeupdate ( oraclepreparedstatementwrapper.java:1061) at  Org.iie.dao.impl.OracleGenelDaoImpl.insertDataReturnKeyByReturnInto (oraclegeneldaoimpl.java:160) at  Org.iie.dao.impl.OracleGenelDaoImpl.main (oraclegeneldaoimpl.java:148)

By the way, the method of obtaining serial number is posted:


Public static int insertdatareturnkeybyreturninto ()  throws Exception {         connection conn = globaldata.getoracleconnection ();         String vsql =  "Insert into xx (ID)  values (xx_squencee.nextval)  returning id into :1 ";         OraclePreparedStatement pstmt =  (oraclepreparedstatement)   Conn.preparestatement (Vsql);         pstmt.registerreturnparameter (1,  types.bigint);         pstmt.executeupdate ();         resultset rs = pstmt.getreturnresultset ();         rs.next ();         int id =  rs.getint (1);      &NBsp;  rs.close ();         pstmt.close ();         system.out.print ("ID:"  + id);         return id;    }


This article is from the "I Will work" blog, please be sure to keep this source http://meijia.blog.51cto.com/8684191/1586548

Oracle Exceptions: Features not supported by the returning clause

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.