You are here: Problem binding variables to Oracle statements « PHP Programming Language « IT news, forums, messages
Problem binding variables to Oracle statements

Posted by final74 on 10/21/32 11:34

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.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация