oracel存储过程:create or replace package AA_TEST is -- Author : ADMINISTRATOR
-- Created : 2012-5-21 12:30:24
-- Purpose : -- Public type declarations
type myCursor is ref cursor;
procedure getSysdate(in_byzd1 in string,
in_byzd2 in string,
in_byzd3 in string,
out_flag out string,
out_msg out string,
o_cursor out myCursor);
end AA_TEST;
/
create or replace package body AA_TEST is
procedure getSysdate(in_byzd1 in ,
in_byzd2 in string,
in_byzd3 in string,
out_flag out string,
out_msg out string,
o_cursor out myCursor) is
begin
out_flag := '1';
out_msg :='执行成功!';
open o_cursor for
select sysdate,in_byzd1,in_byzd2,in_byzd3 from dual;
end;
end AA_TEST;
/
php代码$sql_sp = "begin HTS.AA_TEST.getSysdate(:in_byzd1,:in_byzd2,:in_byzd3,:out_flag,:out_msg,:o_cursor); end;";
$stmt = oci_parse($conn, $sql_sp);
oci_bind_by_name($stmt,':in_byzd1',$in_byzd1);
oci_bind_by_name($stmt,':in_byzd2',$in_byzd2);
oci_bind_by_name($stmt,':in_byzd3',$in_byzd3);
oci_bind_by_name($stmt,':out_flag',$out_flag);
oci_bind_by_name($stmt,':out_msg',$out_msg);
oci_bind_by_name($stmt,':o_cursor',$o_cursor);
oci_execute($stmt);
$result=oci_fetch_assoc($stmt);
print_r($result);
出现错误Warning: oci_execute(): ORA-06550: 第 1 行, 第 7 列: PLS-00306: 调用 'GETSYSDATE' 时参数个数或类型错误 ORA-06550: 第 1 行, 第 7 列: PL/SQL: Statement ignored in C:\xampp\htdocs\ceshi\index.php on line 15刚接触php链接oracle这块!求大神快乐指教phporacle存储
-- Created : 2012-5-21 12:30:24
-- Purpose : -- Public type declarations
type myCursor is ref cursor;
procedure getSysdate(in_byzd1 in string,
in_byzd2 in string,
in_byzd3 in string,
out_flag out string,
out_msg out string,
o_cursor out myCursor);
end AA_TEST;
/
create or replace package body AA_TEST is
procedure getSysdate(in_byzd1 in ,
in_byzd2 in string,
in_byzd3 in string,
out_flag out string,
out_msg out string,
o_cursor out myCursor) is
begin
out_flag := '1';
out_msg :='执行成功!';
open o_cursor for
select sysdate,in_byzd1,in_byzd2,in_byzd3 from dual;
end;
end AA_TEST;
/
php代码$sql_sp = "begin HTS.AA_TEST.getSysdate(:in_byzd1,:in_byzd2,:in_byzd3,:out_flag,:out_msg,:o_cursor); end;";
$stmt = oci_parse($conn, $sql_sp);
oci_bind_by_name($stmt,':in_byzd1',$in_byzd1);
oci_bind_by_name($stmt,':in_byzd2',$in_byzd2);
oci_bind_by_name($stmt,':in_byzd3',$in_byzd3);
oci_bind_by_name($stmt,':out_flag',$out_flag);
oci_bind_by_name($stmt,':out_msg',$out_msg);
oci_bind_by_name($stmt,':o_cursor',$o_cursor);
oci_execute($stmt);
$result=oci_fetch_assoc($stmt);
print_r($result);
出现错误Warning: oci_execute(): ORA-06550: 第 1 行, 第 7 列: PLS-00306: 调用 'GETSYSDATE' 时参数个数或类型错误 ORA-06550: 第 1 行, 第 7 列: PL/SQL: Statement ignored in C:\xampp\htdocs\ceshi\index.php on line 15刚接触php链接oracle这块!求大神快乐指教phporacle存储
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货