Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-06-2011, 07:18 PM   PM User | #1
Happy_Camper
New to the CF scene

 
Join Date: May 2011
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Happy_Camper is an unknown quantity at this point
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!
Happy_Camper is offline   Reply With Quote
Old 05-06-2011, 11:51 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,653
Thanks: 4
Thanked 2,451 Times in 2,420 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
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.
Fou-Lu is offline   Reply With Quote
Users who have thanked Fou-Lu for this post:
Happy_Camper (05-09-2011)
Old 05-09-2011, 03:28 PM   PM User | #3
Happy_Camper
New to the CF scene

 
Join Date: May 2011
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Happy_Camper is an unknown quantity at this point
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!
Happy_Camper is offline   Reply With Quote
Old 05-09-2011, 04:36 PM   PM User | #4
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,653
Thanks: 4
Thanked 2,451 Times in 2,420 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
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.
Fou-Lu is offline   Reply With Quote
Reply

Bookmarks

Tags
odbc, oracle, php

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:15 AM.


Advertisement
Log in to turn off these ads.