Oracle Stored Procedures
am 11.10.2006 13:19:10 von David Skyers------_=_NextPart_001_01C6ED27.133D29CE
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Hi,
Can anyone help. I'm trying to access an out parameter from an Oracle
Stored Procedure. But I get the following message. I think it might have
something to do with the configuration of our server but I'm not sure.
Warning: ociexecute(): OCIStmtExecute: ORA-06550: line 1, column 20:
PLS-00553: character set name is not recognized ORA-06550: line 0,
column 0: PL/SQL: Compilation unit analysis terminated in
/nfs/rcs/www/webdocs/research/rae2008/staff/dev/rae-system/l ive/test.php
on line 23
The code is below
require_once('conn/ora-conn-lib.php');
$c =3D oraconnect();
// Create database procedure...
$s =3D OCIParse($c, "create procedure proc1(p2 OUT number) as " .
"begin" .
" p2 :=3D 10 + 10;" .
"end;");
OCIExecute($s, OCI_DEFAULT);
// Call database procedure...
=20
$s =3D OCIParse($c, "begin proc1(:bind2); end;");
if(!$s){
die("Problem with passing the SQL. Unable to parse the Oracle
query. Please try something else.\n");
}
=20
OCIBindByName($s, ":bind2", $out_var, 32); // 32 is the return length
error_reporting(E_ALL);
$orares =3D ociexecute($s);
=20
if(!$orares){
die("Problem with EXECUTING the SQL. Unable to execute the Oracle
query. Please try something else.\n");
$oerr =3D OCIError();
if ($oerr['message']){
echo " The error is
$oerr[message]";
}
}
=20
=20
echo "Procedure returned value: " . $out_var;
// Logoff from Oracle...
OCILogoff($c);
=20
?>
--------------------------------------------
David Skyers
Support Analyst
Management Systems, EISD, UCL
Extension: 41849
Tel: 020 7679 1849
Email: d.skyers@ucl.ac.uk
--------------------------------------------=20
------_=_NextPart_001_01C6ED27.133D29CE--