Thursday, July 12, 2018

Banner : Select query using DataCusor example

Banner : Select query using DataCusor example


String sqlAcctTitle = "SELECT FTVACCT_TITLE " +
" FROM FTVACCT " +
" WHERE FTVACCT_COAS_CODE = :KEYBLOC_COAS_CODE1 ";


DataCursor acctCursor = new DataCursor(sqlAcctTitle);

try {
// Setting query parameters and passing the values into query above
//---------------------------------------------------------------------------
ptiCursor.addParameter("KEYBLOC_COAS_CODE", getFormModel().getKeyBlock().getKeyblocCoasCode());


// Open cursor and fetch result into Resultset
//--------------------------------------------------
ptiCursor.open();
ResultSet ptiCursorResults = ptiCursor.fetchInto();

if ( ptiCursorResults != null )
{
// Set the value from ResultSet into each column in each row

ftvacctElement.setDisplayAvailBud(ptiCursorResults.getNumber(0));

}

} catch (Exception e) {
throw new ApplicationException(e);
} finally{
ptiCursor.close();

}
}

No comments:

Post a Comment

AWS how to delete VPC when it has error with Network interface , Gateway decencies

   how to delete VPC when it has error with Network interface , Gateway decencies  in AWS 1. Check if it is running on EC2 instance then Sto...