我有这个 oracle 程序:
procedure ACCOUNT_STATMENT(p_customerid masteraccounts.customerid%type,
p_date1 date,
p_date2 date,
p_val1 out number,
p_val2 out number,
p_grid out sys_refcursor)
我使用 PHP 调用它:
$DATE1 = "1-1-2013";
$DATE2 = "1-4-2013";
$ID = 53721;
$sth1 = $conn->prepare("CALL ISPPRO.USERPKG.ACCOUNT_STATMENT(:p_customerid, :DATE1, :DATE2, :p_val1, :p_val2, :p_grid)");
$sth1->bindParam(":p_customerid", $ID, PDO::PARAM_STR);
$sth1->bindParam(':DATE1', $DATE1, PDO::PARAM_STR);
$sth1->bindParam(':DATE2', $DATE2, PDO::PARAM_STR);
$sth1->bindParam(':p_val1', $p_val1, PDO::PARAM_STR|PDO::PARAM_INPUT_OUTPUT, 4000);
$sth1->bindParam(':p_val2', $p_val2, PDO::PARAM_STR|PDO::PARAM_INPUT_OUTPUT, 4000);
$sth1->bindParam(':p_grid', $p_grid, PDO::PARAM_STR|PDO::PARAM_INPUT_OUTPUT, 4000);
$sth1->execute();
print_r($conn->errorInfo());
$result = $sth1->fetchAll();
print_r($result);
print_r($p_val1);
print_r($p_val2);
print_r($p_grid);
我得到这个错误:
Array
(
[0] => HY000
[1] => 6553
[2] => OCIStmtExecute: ORA-06553: PLS-306: wrong number or types of arguments in call to 'ACCOUNT_STATMENT'
(/root/downloads/PDO_OCI-1.0/oci_statement.c:142)
)
问题是什么?