0% found this document useful (0 votes)
378 views

Calling PL SQL Function From OAF Page

To call a PL/SQL function from an Oracle Application Framework (OAF) page, developers must: 1. Create a CallableStatement object with a PL/SQL block invoking the function 2. Bind any input or output parameters 3. Execute the statement and optionally retrieve any output parameters or the function's return value 4. Close the statement

Uploaded by

suri2221
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
378 views

Calling PL SQL Function From OAF Page

To call a PL/SQL function from an Oracle Application Framework (OAF) page, developers must: 1. Create a CallableStatement object with a PL/SQL block invoking the function 2. Bind any input or output parameters 3. Execute the statement and optionally retrieve any output parameters or the function's return value 4. Close the statement

Uploaded by

suri2221
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Calling PL/SQL Function from OAF Page

To invoke a stored function from within an entity object or an application module, you need to
follow below steps:
1. Create a CallableStatement with the PL/SQL block containing the stored function invocation
2. Bind any parameters ( IN or OUT )
3. Execute the statement.
4. Optionally retrieve the values of any OUT parameters or return value of function
5. Close the statement.

below example will exemplify the above steps

Stored Function Calling Code:



public void testFunction() {
OADBTransaction txn = getDBTransaction();
CallableStatement callableStatement =txn.createCallableStatement("begin
:1 := xx_function(:2); end;",OADBTransaction.DEFAULT);
try
{
callableStatement.registerOutParameter(1, Types.VARCHAR);
callableStatement.setString(2, "mahi");
String outParamValue = null;
callableStatement.execute();
outParamValue = callableStatement.getString(1);
callableStatement.close();
}
catch (SQLException sqle)
{
callableStatement.close();
}
}

You might also like