473,399 Members | 3,106 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,399 software developers and data experts.

ora_bind - what does it do?

Hi everyone

Can anybody give me a decent explanation of what ora_bind is supposed to do?

I assumed it did the same sort of thing as Perl's DBI bind_columns function
ie. as each column is returned from a $statement_handle->execute, it assigns
the returning values to the Perl variables eg [note this is Perl]:

$sql = select netware_id, windows_user_id, exchange_id, machine_name,
ip_address, context, running_on, to_char(created,'yyyy-mm-dd')
from mail
my $sth = $dbh->prepare($sql) || Carp::croak $dbh->errstr." - PREPARE\n";
$sth->execute || Carp::croak $dbh->errstr." - EXECUTE\n";
$sth->bind_columns(\$netware_id, \$windows_id, \$exchange_id,
\$machine_name, \$ip_address, \$context, \$os, \$created);
while ($sth->fetchrow_arrayref) {
.... in this while loop, $netware_id will be set to the first returning
value, $windows_id to the second etc....

I tried this in PHP a follows:

$handle = ora_plogon($settings['OraUser'], $settings['OraPass']) or
die("Can't connect");
$cursor = ora_open($handle) or die("<b>Error - can't execute $cursor");
$sql = "SELECT :machine_name, :exchange_id
FROM MAIL
where ....
";

ora_parse($cursor, $sql) or die("Can't parse $sql");

ora_bind($cursor, "machine_name", ":machine_name", 20) or die("Can't bind
machine_name");
ora_bind($cursor, "exchange_id", ":exchange_id", 30) or die("Can't bind
exchange ID");

ora_exec($cursor) or die("<b>Execute: ".ora_errorcode($cursor));

while(ora_fetch($cursor)) {
....

but I just get:
Warning: Can't find variable for parameter in
/export/apache/htdocs/ecensus.nat.bt.com/test2.php on line 19
Execute: 0

I can achieve what I'm after by using ora_getcolumn but am interested to
know why I can't seem to bind variables.

Could somebody tell me if I'm completely mistaken in thinking that PHP's
ora_bind function is completely different than Perl's bind_columns? IMO
either the PHP manual's ora_bind example needs simplifying or it needs to be
explained more clearly what the function does.

cheers
Rob
Jul 16 '05 #1
0 1850

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

Similar topics

7
by: Jonas | last post by:
This works fine in Win XP but does not work at all in Win 98. Private WithEvents objIExplorer As InternetExplorer I have to do it like this to get it to work in Win 98 Dim objIExplorer As...
3
by: Jukka K. Korpela | last post by:
I have noticed that the meaning of visibility: collapse has been discussed on different forums, but with no consensus on what it really means. Besides, implementations differ. The specification...
11
by: Grant Edwards | last post by:
I've read over and over that Python leaves floating point issues up to the underlying platform. This seems to be largely true, but not always. My underlying platform (IA32 Linux) correctly...
0
by: Dirk Försterling | last post by:
Hi all, a few days ago, I upgraded from PostgreSQL 7.2.1 to 7.4, following the instructions in the INSTALL file, including dump and restore. All this worked fine without any error (message). ...
12
by: Frank Hauptlorenz | last post by:
Hello Out there! I have a DB2 V7.2 Database (Fix11) on Win 2000 Professional. It was before a NT 4 based Domain - now it is a Win 2000 Domain. The database server is a domain member. Now...
1
by: Georg Scholz | last post by:
Hello, The class "Control" contains a documented Property "ControlType". So for example, in a form, you can write code like this: Dim c as control set c = me.Controls("textbox1") if...
5
by: Barry Anderberg | last post by:
I'm using a tool by Sci-Tech called the .NET Memory Profiler. We have a massive .NET/C# application here and it has been exhibiting memory leak behavior for some time. Attempting to remedy the...
5
by: Genboy | last post by:
My "VIS" Website, which is a C# site created in VS.NET, Framework 1.1, is no longer compiling for me via the command line. As I have done 600 times in the last year and a half, I can compile to...
16
by: lawrence k | last post by:
I've a file upload script on my site. I just now used it to upload a small text document (10k). Everything worked fine. Then I tried to upload a 5.3 meg Quicktime video. Didn't work. I've...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.