How to call an Oracle procedure from Php and also

  • 16 years ago

    Hi Everyone,


     Hope that all is well.


     I'm trying to call an oracle store procedure and obtain a return value
    from the procedure. I tried just calling the procedure with no return
    value and it was successful. The code is as follows (assuming the
    connection has already being made):


       $sql = "begin gcnadm.pinsgsdata ('$requestid'); end;";
       $cur = oraopen($this->conn);
       $rc = ora
    parse($cur, $sql, 0);
       $rc2 = ora_exec($cur);


     This call worked fine and the procedure was executed.


     However, when I try to call with 2 parameters (the last one being the
    return value placeholder), it doesn't work. The code is as follows:


       $sql = "begin gcnadm.pinsgsdata2 ($requestid, $returnval); end;";
       $cur = oraopen($this->conn);
       $rc = ora
    parse($cur, $sql, 0);
       $rc2 = ora_exec($cur);


     The above doesn't even parse. I tried with quotes around the returnval field and nothing.


     Thanks in advance for your time. Any help is appreciated.


    Regards,


    Rudi28



Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“God could create the world in six days because he didn't have to make it compatible with the previous version.”