note 101168 rejected from function.oci-bind-array-by-name by danbrown
| From: | danbrown@php.net | Date: | Tue, 30 Nov 2010 20:12:28 +0000 |
| Subject: | note 101168 rejected from function.oci-bind-array-by-name by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-174492@lists.php.net to get a copy of this message | ||
Note Submitter: jviqueira at gmail dot com
----
I try to use this function but oci_bind_array_by_name() don't support ARRAY TYPES from Oracle
:(
Example:
-- Oracle Side - Extract of package declaration:
TYPE T_REFCUR IS REF CURSOR;
TYPE STR_FIELDS IS VARRAY(30) OF VARCHAR2(30);
FUNCTION GETDATA(p_id IN NUMBER, p_fields IN STR_FIELDS) RETURN T_REFCUR;
-- Apache Server Side - Extract of PHP code:
...
$fields[]="One";
$fields[]="Two";
$fields[]="Three";
$ps = oci_parse($connection, "begin :cursor := PKG.GETDATA(:id , :fields); end;");
... //I only write here the bind of ":fields"...
oci_bind_array_by_name($ps, ":fields", $fields, count($fields), -1, SQLT_CHR);
$result = oci_execute($ps);
ERROR:
ORA-06550: line XX, column XX: PLS-00306: wrong number or types of arguments in call to
'GETDATA' ORA-06550: line XX, column XX: PL/SQL: Statement ignored