PL/SQL EO design and development

Source: Internet
Author: User

1.INSERT

When you call PL/SQL to insert, you do not use super (), you should create your own callable statement at this time;

Call the Checkerrors () method after performing an callable statement handling exception

protected void InsertRow ()
{
Try
{
String insertstmt = "BEGIN Insert_record (" +
"PARAM1" +: 1, "+
"PARAM2" +: 2, "+
"PARAM3" +: 3, "+
"PARAM4": 4); END; ";

     Dbtransaction Trxn = Getdbtransaction ();      CallableStatement insertstmt = Trxn.createcallablestatement (insertstmt, 1);            Rebind Parameters      insertstmt.setstring (1, Getfirstname ());      Insertstmt.setstring (2, Getlastname ());      Insertstmt.setstring (3, GetAddress1 ());      
     Execute the statement      
     //oaexceptionutils.checkerrors as per plsql API standards         }    catch ( SQLException SqlE)    {       ...    }  }

If you had any calculations for any of your EO columns in your PL/SQL procedure, and if you would like to reflect those V Alues in your EO after row insertion in the database, then you should include those columns in your view object SQL and do The following:

Txn.commit ();
Vo.executequery ();

Clear the EO cache

Clearentitycache ();

PL/SQL EO design and development

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.