Callable Statement
Callable Statement
Example Code:
OADBTransaction oadbtransaction=oa.getOADBTransaction();
OracleCallableStatement oraclecallablestatement ;
String sql = "BEGIN proc_name (:1, :2); END;";
oraclecallablestatement = (OracleCallableStatement)
oadbtransaction.createCallableStatement(sql, -1);
try {
oraclecallablestatement.setInt(1, asg_id);
oraclecallablestatement.registerOutParameter(2,OracleTypes.VARCHAR,0);
oraclecallablestatement.execute();
outvar = oraclecallablestatement.getString(2);
oraclecallablestatement.close();
}
catch(SQLException exception){
outvar = "N";
}
Step1: Create a simple page with one text box and one button, set a new controller on the page
Empno:
Id: empno, DataType: NUMBER, Max Lenght: 4, Prompt: Enter Emp Num
Go Button:
I mports:
import java.sql.SQLException;
import oracle.apps.fnd.framework.server.OADBTransaction;
//Callable Statement
import oracle.jdbc.OracleCallableStatement;
import oracle.jdbc.OracleTypes;