Results 1 to 2 of 2

Thread: Oracle and PHP

  1. #1
    Join Date
    Jun 2003
    Posts
    294

    Lightbulb Unanswered: Oracle and PHP

    URGENT !!!!!!!!!!!!!!!!

    I'm trying to execute an oracle9i stored procedure from php 4.3.3 and I'm using adodb. Well I have been looking for some examples and I found some in
    http://www.exzilla.net/docs/php-oci8/php-plsql.php

    I did what they say there, and I get an error:

    I will attach my files:

    <?php
    $bd = "";
    $conn = ocilogon("turnos", "turnos",$bd);

    $curs = OCINewCursor($conn);
    $stmt = OCIParse($conn,"begin PKG_GENERAL.PCN_CONSULTA_VEHICULOS(curegistro,:Mensaje); end;");

    OCIBindByName($stmt,":Mensaje", &$Mensaje, 50) or die ('Can not bind variable');
    //OCIBindByName($stmt,"ocuregistro",&$curs,-1,OCI_B_CURSOR+OCI_ASSOC);
    OCIBindByName($stmt,"curegistro",&$curs,-1,OCI_B_CURSOR);

    //$gid=""; // for gid = 1 only
    ociexecute($stmt);
    ociexecute($curs);

    while (OCIFetchInto($curs,&$ocuregistro)) {
    var_dump($ocuregistro);
    echo "<pre>";
    print_r($ocuregistro );
    echo "</pre>";
    }

    OCIFreeStatement($stmt);
    OCIFreeCursor($curs);
    OCILogoff($conn);
    ?>

    The error is that I get is

    Warning: ocifetchinto(): OCIFetchInto: ORA-00932: tipos de dato inconsistentes: se esperaba %s se ha obtenido %s in c:\archivos de programa\easyphp1-7\www\turnos\turnos6.php on line 16

  2. #2
    Join Date
    Jun 2003
    Posts
    294
    Pd. the procedure runs ok in SQL plus, and the cursor that I recive is declared in the head of the package like:

    TYPE CURGENERAL IS REF CURSOR;

    and In the procedure body I recibe the parameter like:

    PCN_CONSULTA_VEHICULOS(unCrusor IN CURGENERAL);

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •