j_70 wrote:Could you show us your complete oracle code. OCIFetchInto fetches one row at a time. I only see one loop, but three different fetch statements.
Here is the full coding
function getCustomerDetails($userName,$userType){
//echo "<h1>userName".$userName."</h1><br>";
//echo "<h1>userType".$userType."</h1><br>";
$thisConnection = $this->var;
$curs_contactAddress = OCINewCursor($thisConnection);
$curs_billingAddress = OCINewCursor($thisConnection);
$curs_refAdditionalInfo = OCINewCursor($thisConnection);
$stmt_getCustomerDetails = OCIParse($thisConnection, "begin :ret := tx_interface01.getCustomerDetails(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12,:13,:14,:15,:16,:17,:18,:19,:20,:21,:22,:23,:24,:25,:26,:27); end;");
OCIBindByName($stmt_getCustomerDetails, ":1", $userName); //IN
OCIBindByName($stmt_getCustomerDetails, ":2", $userType); //IN
OCIBindByName($stmt_getCustomerDetails, ":3", $custKeyvalue, 20); //OUT
OCIBindByName($stmt_getCustomerDetails, ":4", $Title, 20); //OUT
OCIBindByName($stmt_getCustomerDetails, ":5", $Initials, 20); //OUT
OCIBindByName($stmt_getCustomerDetails, ":6", $firstName, 20); //OUT
OCIBindByName($stmt_getCustomerDetails, ":7", $lastName, 20); //OUT
OCIBindByName($stmt_getCustomerDetails, ":8", $otherNames, 20); //OUT
OCIBindByName($stmt_getCustomerDetails, ":9", &$curs_contactAddress, -1, OCI_B_CURSOR);
OCIBindByName($stmt_getCustomerDetails, ":10", &$curs_billingAddress, -1, OCI_B_CURSOR);
OCIBindByName($stmt_getCustomerDetails, ":11", $trustKeyvalue, 20); //OUT
OCIBindByName($stmt_getCustomerDetails, ":12", $trustInitials, 20); //OUT
OCIBindByName($stmt_getCustomerDetails, ":13", $trustFirstName, 20); //OUT
OCIBindByName($stmt_getCustomerDetails, ":14", $trustLastName, 20); //OUT
OCIBindByName($stmt_getCustomerDetails, ":15", $trustOtherNames, 20); //OUT
OCIBindByName($stmt_getCustomerDetails, ":16", &$curs_refAdditionalInfo, -1, OCI_B_CURSOR);
OCIBindByName($stmt_getCustomerDetails, ":17", $custSince, 20); //OUT
OCIBindByName($stmt_getCustomerDetails, ":18", $creditLimit, 20); //OUT
OCIBindByName($stmt_getCustomerDetails, ":19", $Outstanding, 20); //OUT
OCIBindByName($stmt_getCustomerDetails, ":20", $lastBillDate, 20); //OUT
OCIBindByName($stmt_getCustomerDetails, ":21", $nextBillDate, 20); //OUT
OCIBindByName($stmt_getCustomerDetails, ":22", $balanceLastBill, 20); //OUT
OCIBindByName($stmt_getCustomerDetails, ":23", $conPerson, 20); //OUT
OCIBindByName($stmt_getCustomerDetails, ":24", $ccNumber, 20); //OUT
OCIBindByName($stmt_getCustomerDetails, ":25", $Prepaid, 20); //OUT
OCIBindByName($stmt_getCustomerDetails, ":26", $errorLevel, 20); //OUT
OCIBindByName($stmt_getCustomerDetails, ":27", $errorText, 20); //OUT
OCIBindByName($stmt_getCustomerDetails, ":ret", $r, 20); //OUT
OCIExecute($stmt_getCustomerDetails,OCI_DEFAULT);
OCIExecute($curs_contactAddress,OCI_DEFAULT);
OCIExecute($curs_billingAddress,OCI_DEFAULT);
OCIExecute($curs_refAdditionalInfo,OCI_DEFAULT);
while (OCIFetchInto($curs_contactAddress,&$data_contactAddress)) { } //not working
while (OCIFetchInto($curs_billingAddress,&$data_billingAddress)) { }
////// while (OCIFetchInto($curs_refAdditionalInfo,&$data_refAdditionalInfo)) { }
while (OCIFetchInto($curs_refAdditionalInfo,&$data_refAdditionalInfo)) {
$retArrayAdditionalInfo[] = $data_refAdditionalInfo;
}
$out_data["custKeyvalue"] = $custKeyvalue;
$out_data["Title"] = $Title;
$out_data["Initials"] = $Initials;
$out_data["firstName"] = $firstName;
$out_data["lastName"] = $lastName;
$out_data["otherNames"] = $otherNames;
$out_data["contactAddress"] = $data_contactAddress;
$out_data["billingAddress"] = $data_billingAddress;
$out_data["trustKeyvalue"] = $trustKeyvalue;
$out_data["trustInitials"] = $trustInitials;
$out_data["trustFirstName"] = $trustFirstName;
$out_data["trustLastName"] = $trustLastName;
$out_data["trustOtherNames"] = $trustOtherNames;
//$out_data["AdditionalInfo"] = $data_refAdditionalInfo;
$out_data["AdditionalInfo"] = $retArrayAdditionalInfo;
$out_data["custSince"] = $custSince;
$out_data["creditLimit"] = $creditLimit;
$out_data["Outstanding"] = $Outstanding;
$out_data["lastBillDate"] = $lastBillDate;
$out_data["nextBillDate"] = $nextBillDate;
$out_data["balanceLastBill"] = $balanceLastBill;
$out_data["conPerson"] = $conPerson;
$out_data["ccNumber"] = $ccNumber;
$out_data["Prepaid"] = $Prepaid;
$out_data["errorLevel"] = $errorLevel;
$out_data["errorText"] = $errorText;
return($out_data);
oci_free_statement($stmt_getCustomerDetails);
oci_free_statement($curs_contactAddress);
oci_free_statement($curs_billingAddress);
oci_free_statement($curs_refAdditionalInfo);
///////////oci_close($thisConnection);
}//End of the function getCustomerDetails //new end