我想插入下面的默認值,當我運行服務我得到這個下面的錯誤任何一個請告訴我如何解決。當我運行多執行語句服務時,我得到了錯誤「無法讀取屬性」參數「null」
腳本運行時錯誤( 「過程: 'CustomPersonalGS實踐' ProcessItem: '初始化' 類型: '項'」 -1:-1).TypeError:無法從空讀取屬性 「參數」
//Initialise SQL Query List
tw.local.sqlQueries = new tw.object.listOf.SQLStatement();
tw.local.sql = "";
tw.local.customerPD = new tw.object.customerPD1BO();
tw.local.customerPD.customerPersonalDetailsList = new tw.object.listOf.customerSpecificPersonalDetailsListBO();
var custPersonalDetails = new tw.object.customerSpecificPersonalDetailsListBO();
custPersonalDetails.customerId = "8467";
custPersonalDetails.custPersonalDetailsId = "8";
custPersonalDetails.isBPMEnabled = true;
custPersonalDetails.isCCPEnabled = true;
custPersonalDetails.isCCPMandatory = true;
custPersonalDetails.isLatestVersion = true
tw.local.customerPD.customerPersonalDetailsList.insertIntoList(tw.local.customerPD.customerPersonalDetailsList.listLength, custPersonalDetails);
tw.local.sql = "INSERT INTO CUSTOMPERSONALDETAILSQUESTION(CUSTOMERID,CUSTPERSONLADETAILSID,ISBPMENABLED,ISCCPENABLED,ISCCPMANDATORY,ISLATESTVERSION) VALUES (?,?,?,?,?,?) ";
function addSQLStatement() {
tw.local.sqlQueries[tw.local.sqlQueries.listLength] = new tw.object.SQLStatement();
}
function addParam(value,type,mode) {
log.info("VALUE :" + value);
var newParam = new tw.object.SQLParameter();
newParam.value = value;
newParam.type = type;
newParam.mode = mode;
if(tw.local.sqlQueries == null){
tw.local.sqlQueries = new tw.object.listOf.SQLStatement();
}
if(tw.local.sqlQueries[tw.local.sqlQueries.listLength] == null){
tw.local.sqlQueries.insertIntoList(tw.local.sqlQueries.listLength, new tw.object.SQLStatement());
}
if(tw.local.sqlQueries[tw.local.sqlQueries.listLength].parameters == null){
tw.local.sqlQueries[tw.local.sqlQueries.listLength].parameters = new tw.object.listOf.SQLParameter();
}
var paramsLength = tw.local.sqlQueries[tw.local.sqlQueries.listLength].parameters.listLength;
tw.local.sqlQueries[tw.local.sqlQueries.listLength].parameters[paramsLength] = newParam;
}
for(var i=0;i<tw.local.customerPD.customerPersonalDetailsList.listLength;i++){
addSQLStatement(tw.local.sql);
\t addParam(tw.local.customerPD.customerPersonalDetailsList[i].customerId,"VARCHAR","IN");
\t addParam(tw.local.customerPD.customerPersonalDetailsList[i].custPersonalDetailsId,"VARCHAR","IN");
\t var yesNoFlag = "N";
\t if(tw.local.customerPD.customerPersonalDetailsList[i].isBPMEnabled){
\t \t yesNoFlag="Y";
\t \t addParam(yesNoFlag,"CHAR","IN");
\t }
\t yesNoFlag = "N";
\t if(tw.local.customerPD.customerPersonalDetailsList[i].isCCPEnabled){
\t \t yesNoFlag="Y";
\t \t addParam(yesNoFlag,"CHAR","IN");
\t }
\t yesNoFlag = "N";
\t if(tw.local.customerPD.customerPersonalDetailsList[i].isCCPMandatory){
\t \t yesNoFlag="Y";
\t \t addParam(yesNoFlag,"CHAR","IN");
\t }
\t yesNoFlag = "N";
\t if(tw.local.customerPD.customerPersonalDetailsList[i].isLatestVersion){
\t \t yesNoFlag="Y";
\t \t addParam(yesNoFlag,"CHAR","IN");
\t }
} \t