Thursday, July 12, 2018

Banner 9 Insert data to table and Select multiple row


Banner 9 Insert data to table and Select multiple row


String sqlc1 = "SELECT * " +
   " FROM FFRMASF " +
   " WHERE FFRMASF_OTAG_CODE = :FFBMAST_OTAG_CODE ";
DataCursor c1 = new DataCursor(sqlc1);
TableRow recType3= null;
try{
//Setting query parameters
c1.addParameter("FFBMAST_OTAG_CODE", ffbmastElement.getFfbmastOtagCode());
c1.open();
while (true) {
recType3 = c1.fetchRow();


//recType3.getNumber("FFRMASF_AMT") = 0;

if ( c1.notFound() )
break;
parCoasCode=recType3.getStr("ffrmasf_coas_code");
FFRMASF_FUND_CODE=recType3.getStr("ffrmasf_fund_Code");


try{
//Setting query parameters
findEquity.addParameter("P_PAR_COAS_CODE", parCoasCode);

findEquity.open();
ResultSet findEquityResults = findEquity.fetchInto();
if ( findEquityResults != null ) {
holdPlant = findEquityResults.getStr(0);
}
if ( findEquity.notFound() || holdPlant.isNull() ){
try{
parCoasCode=recType3.getStr("ffrmasf_coas_Code");
//Setting query parameters
findEquityTwo.addParameter("P_PAR_COAS_CODE", parCoasCode);

findEquityTwo.open();
ResultSet findEquityTwoResults = findEquityTwo.fetchInto();
if ( findEquityTwoResults != null ) {
holdPlant = findEquityTwoResults.getStr(0);
}
}finally{
findEquityTwo.close();
}
}
}finally{
findEquity.close();
}

parCoasCode=recType3.getStr("ffrmasf_coas_Code");


try{
//Setting query parameters
fundFund.addParameter("P_PAR_FUND_CODE", parFundCode);

fundFund.open();
ResultSet fundFundResults = fundFund.fetchInto();
if ( fundFundResults != null ) {
holdFundFtyp = fundFundResults.getStr(0);

}
}finally{
fundFund.close();
}


parCoasCode=recType3.getStr("ffrmasf_coas_Code");
parFtypCode=holdFundFtyp;

try{
//Setting query parameters
fundInternal.addParameter("EFFDATE_EFF_DATE_TIME", getFormModel().getFormHeader().getEffdateEffDateTime());

fundInternal.open();
ResultSet fundInternalResults = fundInternal.fetchInto();
if ( fundInternalResults != null ) {
holdInternal = fundInternalResults.getStr(0);
}

}else {
if ( holdPlantFund.isNull() ){
parCoasCode=recType3.getStr("ffrmasf_coas_Code");
try{
//Setting query parameters
fundInternalTwo.addParameter("P_PAR_COAS_CODE", parCoasCode);

fundInternalTwo.open();
ResultSet fundInternalTwoResults = fundInternalTwo.fetchInto();
if ( fundInternalTwoResults != null ) {
holdPlantFund = fundInternalTwoResults.getStr(0);
}
FFRMASF_FUND_CODE = holdPlantFund;
}finally{
fundInternalTwo.close();
}

}
FFRMASF_FUND_CODE = holdPlantFund;
}
}finally{
fundInternal.close();
}


parCoasCode=recType3.getStr("ffrmasf_coas_code");
FFRMASF_ACCT_CODE = recType3.getStr("ffrmasf_Acct_Code");
parAcctCode= FFRMASF_ACCT_CODE;

try{
//Setting query parameters
fundAcct.addParameter("EFFDATE_EFF_DATE_TIME", getFormModel().getFormHeader().getEffdateEffDateTime());

fundAcct.open();
ResultSet fundAcctResults = fundAcct.fetchInto();
if ( fundAcctResults != null ) {
holdAcct = fundAcctResults.getStr(0);
}
}finally{
fundAcct.close();
}


}

String sql1 = "INSERT INTO FFRMASA " +
  "(FFRMASA_OTAG_CODE, FFRMASA_CHANGE_SEQ_NUM, FFRMASA_SEQ_NUM, FFRMASA_ACTIVITY_DATE, FFRMASA_USER_ID, FFRMASA_COAS_CODE, FFRMASA_BANK_CODE, FFRMASA_AMT, FFRMASA_ADJ_AMT, FFRMASA_AMT_PCT, FFRMASA_FUND_CODE_CAP, FFRMASA_ACCT_CODE_ASSET, )" +
  "VALUES (:P_REC_TYPE3_FFRMASF_OTAG_CODE, 0, :P_REC_TYPE3_FFRMASF_SEQ_NUM, :P_REC_TYPE3_FFRMASF_ACTIVITY_DATE, :P_REC_TYPE3_FFRMASF_USER_ID, :P_REC_TYPE3_FFRMASF_COAS_CODE, '', )";
DataCommand command1 = new DataCommand(sql1);
//Setting query parameters
command1.addParameter("P_REC_TYPE3_FFRMASF_OTAG_CODE", recType3.getStr("FFRMASF_OTAG_CODE"));
command1.addParameter("P_REC_TYPE3_FFRMASF_SEQ_NUM", recType3.getNumber("FFRMASF_SEQ_NUM"));
command1.addParameter("P_REC_TYPE3_FFRMASF_ACTIVITY_DATE", recType3.getDate("FFRMASF_ACTIVITY_DATE"));
command1.addParameter("P_REC_TYPE3_FFRMASF_USER_ID", recType3.getStr("FFRMASF_USER_ID"));
command1.addParameter("P_REC_TYPE3_FFRMASF_COAS_CODE", recType3.getStr("FFRMASF_COAS_CODE"));

rowCount = command1.execute();
}
}finally{
c1.close();
}

try{
MessageServices.setMessageLevel(FormsMessageLevel.decodeMessageLevel("5"));
commitTask();
}finally{
MessageServices.setMessageLevel(FormsMessageLevel.decodeMessageLevel("0"));
}

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...