I made a function in pl/sql that return a table of varchar2, I tested it on sqldeveloper and I know it works. But now, I want to retrieve this table with a php project. First of all, I tried this
oci_bind_by_name($stid,":returnValue",$returnValue);
But I'm getting this :
Warning: oci_execute() [function.oci-execute]: ORA-06550: line 2, column 41: PLS-00382: expression is of wrong type ORA-06550: line 2, column 25: PL/SQL: Statement ignored in C:\xampp\htdocs\BCN_REQUETEUR\index.php on line 15
Then I tried with this
oci_bind_array_by_name($stid,":returnValue",$returnValue,250,250);
But I'm getting the same error. So, how can we retrieve this table of varchar2 in php ? Thanks
Edit : I finally succeed, instead of using a pl/sql function, I used a procedure with an 'out parameter' and then in the php side :
$query = "BEGIN
ecrire_requete(30, :thesechar);
END;";
$stid = oci_parse($conn, $query);
$tabvars = oci_new_collection($conn,'MYTABLETYPE');
oci_bind_by_name($stid, ':thesechar', $tabvars, -1, SQLT_NTY);
oci_execute($stid, OCI_DEFAULT);
for ($i = 0;$i < count($tabvars);$i++)
{
echo "<br>".$tabvars->getElem($i);
}