ORA-01036 with oci_bind_by_name

I’m trying to make a SELECT from PHP to Oracle database.

Here is the code i did:

 $sql = "SELECT * FROM
        DEV_F.FO_INPUT i,
        DEV_F.FO_MAIN m
        WHERE m.FOM_ID = i.FIN_FATHER
        AND m.FOM_ID = :traceID";

    $stid = oci_parse($this->connexion(), $sql);


    oci_bind_by_name($stid, 'traceID', $this->escapeString($traceID));

    oci_execute($stid);
    oci_fetch_all($stid, $res);

The request is OK in SQLDevelopper, returns no error, . But php returns:

oci_bind_by_name(): ORA-01036: illegal variable name/number

I tried to add single quotes, to add semicolons etc… Nothing works, i’m pretty stick here.

Any tips ? Did i miss something ?


Source: oracle

Leave a Reply