Friday 29 June 2018

Callablestatement in oaf

Callablestatement in oaf

 
Callablestatement helps to execute the PL/sql block from OAF page controller. We pass PL/SQL block as string paramters in the Callablestatment and callablestatement help to convert this sting in to an executable plsql block to exeute in the Oracle database.Callablestatement also helps to set the parameter for the block in the OAF page controller. If we are using , parameters in the PLSQL block and we are executing this block from
OAF controller then we also set the values in these parameters with the help of the callablestatement. Callablestatement also helps to get the output of the plsql block.
 
Here below I am sharing the sample code of callablestatement in oaf.
 

OAApplicationModule am = (OAApplicationModule)paramOAPageContext.getApplicationModule(paramOAWebBean);
 
OADBTransaction txn = am.getOADBTransaction();
 
String str="BEGIN xx_test_pkg.updaterecord(P_Header_id => :1);END;";
 
OracleCallableStatement Callstmt=(OracleCallableStatement)txn.createCallableStatement(str,1);

String Result = "";
Number localNumber;

try {
Callstmt.setString(1,RptHdrId);
Callstmt.execute();      
Callstmt.close();

 }
catch(SQLException sqle)
  {
paramOAPageContext.writeDiagnostics(this, "Exception in calling sqlstatement  "+sqle, 2);        
}

Callablestatement in oaf
 

1 comments:

Rifath said...

Splendid blog I visit this blog it's unimaginably great. Inquisitively, in this blog substance shaped without a doubt and reasonable. The substance of data is useful.
Oracle Fusion HCM Online Training
Oracle Fusion Financials Online Training

Post a Comment

Contact us for any Collaboration, Project Support & On Job Support Work

Name

Email *

Message *