Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    May 2011
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Calling Oracle Stored Procedure with ODBC with PHP

    I'm trying to connect to an Oracle DB using PHP, ODBC, and calling a stored procedure that contains IN and OUT params. PHP contains ODBC functions that will work for Oracle stored procedures with IN parameters, but does not have anything for OUT parameters. PHP's documentation states to use the OCI8 driver, which I've gotten to work before, but our sys admin cannot get the OCI8 driver to work anymore. So, I'm stuck with trying ODBC. Does anyone know how to do this? Is it possible? Thanks for the help!

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Looks to me like the PDO can be used to call a stored procedure in an oracle with INOUT - best I know the ODBC only does in as you discovered. There is a driver for it as well, so you could start looking there:
    http://php.net/manual/en/pdo.prepared-statements.php
    http://www.php.net/manual/en/ref.pdo-oci.php

    Unfortunately the PDO oracle driver is a new guy on the block, so it is experimental.

  • Users who have thanked Fou-Lu for this post:

    Happy_Camper (05-09-2011)

  • #3
    New to the CF scene
    Join Date
    May 2011
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Went with OCI8

    After looking at ODBC and seeing that it wasn't able to pass out parameters we decided that we would have to get the OCI 8 driver to work. After a couple hours the sys admins were able to get it to work. Thanks for the help!

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Quote Originally Posted by Happy_Camper View Post
    After looking at ODBC and seeing that it wasn't able to pass out parameters we decided that we would have to get the OCI 8 driver to work. After a couple hours the sys admins were able to get it to work. Thanks for the help!
    You betcha.
    I'd rewrite an abstraction layer if I were you, that way you can swap out the OCI8 with the PDO-OCI once its moved above experimental without modifying most code. Done right, it would be a simple implementation class rewrite to overtake the new drivers instead of the old.


  •  

    Tags for this Thread

    Posting Permissions

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