473,411 Members | 1,991 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

Problem binding variables to Oracle statements

Hi
I'm experimenting with PHP5, ORacle 9i and ADODB and have run into
problems trying to bind and output variable.

I can make a successful connection to our database via the MSDAORA
provider but the following simple statement will not work:

$oCMD = new COM("ADODB.command");
$oCMD->ActiveConnection = $dbConn; /// $dbConn generated
earlier ...
$oCMD->Prepared = True;

$oCMD->CommandText = "SELECT 12345 INTO :num FROM dual";

$oCMD->Parameters->Append($oCMD->CreateParameter("num",adInteger,adParamOutput,5)) ;
$oCMD->Execute();
$ans = $oCMD->Parameters->Item("num")->Value;
echo "answer: [$ans] <br />";

This generates the following : answer: []

I've tried binding via the '?' spaceholder as I've been told that
can be used as well but it fails with the following:

Fatal error: Uncaught exception 'com_exception' with message
'Source: Provider
Description: Unspecified error' ....

Can anyone advise as to what I may be doing wrong with the above?
Many thanks.

Dec 14 '05 #1
1 1519
On 14 Dec 2005 05:52:12 -0800, "final74" <ke**********@gmail.com> wrote:
I'm experimenting with PHP5, ORacle 9i and ADODB and have run into
problems trying to bind and output variable.

$oCMD = new COM("ADODB.command");

Can anyone advise as to what I may be doing wrong with the above?


Can't really help with the exact question, but why are you running through
ODBC/ADO/COM when you could use the much better native Oracle support?
Performance, portability and reliability will be better.

In fact there's the (potentially confusingly named) ADOdb library (which has
nothing to do with Windows' ADODB other than a vaguely similar interface) that
does a good job of wrapping up the various PHP native database libraries into a
consistent interface; I use it extensively on Oracle 9i.

http://adodb.sourceforge.net/
http://uk.php.net/oci8
--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Dec 14 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jonathan | last post by:
I'm puzzled by Python's behavior when binding local variables which are introduced within exec() or execfile() statements. First, consider this simple Python program: # main.py def f() : x = 1...
10
by: Saso Zagoranski | last post by:
hi, this is not actually a C# problem but since this is the only newsgroup I follow I decided to post my question here (please tell me where to post this next time if you think this post...
3
by: RDS | last post by:
Does anyone know how to do the following vb6 code using bind variables for oracle dbs, in .net? dim cmdMyCommand as ADODB.COMMAND Set cmdMyCommand = New ADODB.COMMAND With cmdMyCommand...
5
by: Michael Rudolph | last post by:
Hi newsgroup, I have an issue with the configuration of a DB2 federated database (WebSphere Information Integrator) in conjunction with the relational wrapper for Oracle on AIX. DB2 seems to not...
78
by: Josiah Manson | last post by:
I found that I was repeating the same couple of lines over and over in a function and decided to split those lines into a nested function after copying one too many minor changes all over. The only...
8
by: Richard Schulman | last post by:
Sorry to be back at the goodly well so soon, but... ....when I execute the following -- variable mean_eng_txt being utf-16LE and its datatype nvarchar2(79) in Oracle: cursor.execute("""INSERT...
0
by: manir | last post by:
Hi, It would really be of great help if you could suggest a solution for me. Program: I need to execute a stored procedure from an Oracle server through a C++ program using oci.h (Oracle...
30
by: Einstein30000 | last post by:
Hi, in one of my php-scripts is the following query (with an already open db-connection): $q = "INSERT INTO main (name, img, descr, from, size, format, cat, host, link, date) VALUES ('$name',...
0
by: Rauf Sarwar | last post by:
Originally posted by Nelson Broat Have you included Oracle jdbc driver in your classpath? Depending on your Oracle version, it would be ORACLE_HOME/jdbc/lib/classesXXX.zip or classesXXX.jar...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.