Oracle存储过程如下:
create or replace procedure GetOutpatientJFlist
(start_date in date,
end_date in date,
channel in varchar2,
content out sys_refcursor)
is
begin
if channel is null then
open content for select * from v_yyzz_dz WHERE happen_date>=start_date and happen_date<=end_date;
else
open content for select * from v_yyzz_dz WHERE happen_date>=start_date and happen_date<=end_date and cheque_qudao=channel;
end if ;
end GetOutpatientJFlist;
PHP调用过程如下:
$start_date = iconv('UTF-8', 'GBK', $startDate);
$end_date = iconv('UTF-8', 'GBK', $endDate);
$channel = iconv('UTF-8', 'GBK', $canal);
$sql_sp = "BEGIN GetOutpatientJFlist(to_date(:start_date,'yyyy-MM-dd HH24:mi:ss'),to_date(:end_date,'yyyy-MM-dd HH24:mi:ss'),:channel,:content); END;";$temp = $conn->prepare($sql_sp);$temp->bindParam('start_date', $start_date);
$temp->bindParam('end_date', $end_date);
$temp->bindParam('channel', $channel);$temp->bindParam('content', $content, PDO::PARAM_LOB);$temp->execute();打印errorInfo,报错为:
array(3) {
[0]=>
string(5) "HY000"
[1]=>
int(6550)
[2]=>
string(195) "OCIStmtExecute: ORA-06550: 第 1 行, 第 7 列:
PLS-00306: 调用 'GETOUTPATIENTJFLIST' 时参数个数或类型错误
ORA-06550: 第 1 行, 第 7 列:
PL/SQL: Statement ignored
(ext\pdo_oci\oci_statement.c:157)"
}