Closed barrigapicante closed 4 years ago
Hello man, update ready, I tested checking the datatype with an output parameter and it work correctly:
CREATE OR REPLACE PROCEDURE PRUEBA_FUNC_CURSOR_1(P_CUR OUT ARRAY_DATOS2) IS v_num number; BEGIN P_CUR := ARRAY_DATOS2(); FOR R_D IN (SELECT CONTENIDO AS DATOS FROM ARAUCANO) LOOP P_CUR.EXTEND; P_CUR(P_CUR.LAST) := R_D.DATOS; END LOOP; END;
$prueba = null; //$prueba = oci_new_collection($conn,'ARRAY_DATOS2','SIUC'); $options = array("type_name" => "ARRAY_DATOS2","schema" => "SIUC"); $pdo = DB::getPdo(); $stmt_rec = $pdo->prepare("begin SIUC.PRUEBA_FUNC_CURSOR_1(:p2); end;"); $stmt_rec->bindParam(':p2', $prueba, SQLT_NTY, -1, $options); $result = $stmt_rec->execute();
foreach ($prueba as $key => $value) {
echo($prueba->getElem(intval($key)));
}
dd("");
Fix https://github.com/yajra/pdo-via-oci8/issues/73.