473,382 Members | 1,583 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,382 software developers and data experts.

CLI0005W from query with join in PHP script

Folks,

I have a PHP script that does:

$statement = 'SELECT tbl1.col1, tbl2.col2 FROM tbl1, tbl2';
$result = odbc_prepare($dbconn, $statement);

It succeeds, but always generates warning:

PHP Warning: odbc_prepare(): SQL error: [IBM][CLI Driver] CLI0005W Option value changed. SQLSTATE=01S02, SQL state 01S02 in SQLPrepare in C:\temp\cli0005w.php on line 28

Warning: odbc_prepare(): SQL error: [IBM][CLI Driver] CLI0005W Option value changed. SQLSTATE=01S02, SQL state 01S02 in SQLPrepare in C:\temp\cli0005w.php on line 28

I think I understand what the error means. When I use the Microsoft ODBC driver it says:

Warning: odbc_result() [function.odbc-result]: SQL error: [Microsoft][ODBC Cursor Library] Positioned request cannot be performed because result set was generated by a join condition, SQL state SL002 in SQLGetData in C:\My Server\gallery2\test-non-adodb.php on line 83

So I presume the CLI0005W means CLI is invoking some extra hoops in order to execute the statement, for which I am grateful, but I don't want PHP to report it.

I've tried modifying the error_reporting() in the PHP script, but can't seem to get rid of the warning.

Is there any way to suppress (or prevent) these warnings at either level, DB2 or PHP?

Thanks.

--
--------------------
Larry Menard
"Defender of Geese and of All Things Natural"
Nov 23 '05 #1
5 4392
Larry Menard wrote:
Folks,

I have a PHP script that does:

$statement = 'SELECT tbl1.col1, tbl2.col2 FROM tbl1, tbl2';
$result = odbc_prepare($dbconn, $statement);

It succeeds, but always generates warning:

PHP Warning: odbc_prepare(): SQL error: [IBM][CLI Driver] CLI0005W
Option value changed. SQLSTATE=01S02, SQL state 01S02 in SQLPrepare in
C:\temp\cli0005w.php on line 28

Warning: odbc_prepare(): SQL error: [IBM][CLI Driver] CLI0005W Option
value changed. SQLSTATE=01S02, SQL state 01S02 in SQLPrepare in
C:\temp\cli0005w.php on line 28

I think I understand what the error means. When I use the Microsoft
ODBC driver it says:

Warning: odbc_result() [function.odbc-result]: SQL error:
[Microsoft][ODBC Cursor Library] Positioned request cannot be performed
because result set was generated by a join condition, SQL state SL002 in
SQLGetData in C:\My Server\gallery2\test-non-adodb.php on line 83

So I presume the CLI0005W means CLI is invoking some extra hoops in
order to execute the statement, for which I am grateful, but I don't
want PHP to report it.

I've tried modifying the error_reporting() in the PHP script, but can't
seem to get rid of the warning.

Is there any way to suppress (or prevent) these warnings at either
level, DB2 or PHP?


If you don't add an explicit FOR READ ONLY at the end of the query, PHP
automatically adds a FOR UPDATE. So it tries to give you an updatable
cursor on a joined table, and that cannot work. Add the FOR READ ONLY and
you should by fine. I found that adding this clause wherever possible is a
good idea when PHP is involved.

Oh, and if you use PHP with BLOBs, you might hit quite a few problems...

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Nov 24 '05 #2
The Unified ODBC extension for PHP uses scrollable cursors for every
query in DB2. Worse, it uses a kind of scrollable cursor that DB2
doesn't support, so the client and server go back and forth negotiating
a supported scrollable cursor level _for every row you request_. Which
means that retrieving data from a remote server is crazy slow.

All of this, along with workarounds for the problem, is well-documented
here:
http://www-128.ibm.com/developerwork...ott/index.html

I see you're using ADODB; we really need to get the ibm_db2 extension
for PHP (http://php.net/ibm_db2) supported in ADODB, because until
that's available anybody using ADODB to connect to DB2 through Unified
ODBC is going to think that the database is the bottleneck. The ibm_db2
extension does things right (including BLOB support, defaulting to
forward-only cursors but enabling you to use scrollable cursors on a
statement by statement basis, and support for OUT/INOUT parameters in
stored procedures).

Dan

Nov 24 '05 #3
Thanks, Knut & Dan.

That was the problem, thanks. I had forgotten that particular nastiness,
and didn't realize this was a case of it.

My simple test described below was not using ADOdb, but Dan knows that
the original application (from which I rendered the testcase) is. On one
hand I await support for ibm-db2 in ADOdb anxiously, but on the other hand I
know that no change is ever without its new problems. ;-)

--
--------------------
Larry Menard
"Defender of Geese and of All Things Natural"
"Dan Scott" <de*****@gmail.com> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...
The Unified ODBC extension for PHP uses scrollable cursors for every
query in DB2. Worse, it uses a kind of scrollable cursor that DB2
doesn't support, so the client and server go back and forth negotiating
a supported scrollable cursor level _for every row you request_. Which
means that retrieving data from a remote server is crazy slow.

All of this, along with workarounds for the problem, is well-documented
here:
http://www-128.ibm.com/developerwork...ott/index.html

I see you're using ADODB; we really need to get the ibm_db2 extension
for PHP (http://php.net/ibm_db2) supported in ADODB, because until
that's available anybody using ADODB to connect to DB2 through Unified
ODBC is going to think that the database is the bottleneck. The ibm_db2
extension does things right (including BLOB support, defaulting to
forward-only cursors but enabling you to use scrollable cursors on a
statement by statement basis, and support for OUT/INOUT parameters in
stored procedures).

Dan

Nov 24 '05 #4
Turns out I'm still getting the CLI0005W from a lot of queries. One
example is a query that does a select from a LONG VARCHAR column.

Is this the same problem Knut mentioned regarding BLOBs? In Clara Liu's
article she mentions LOBs getting CLI0005W, but her solution is to use FOR
READ ONLY. I'm now using that clause, and it isn't helping.

Any other suggestions?

Thanks.
--
--------------------
Larry Menard
"Defender of Geese and of All Things Natural"
"Dan Scott" <de*****@gmail.com> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...
The Unified ODBC extension for PHP uses scrollable cursors for every
query in DB2. Worse, it uses a kind of scrollable cursor that DB2
doesn't support, so the client and server go back and forth negotiating
a supported scrollable cursor level _for every row you request_. Which
means that retrieving data from a remote server is crazy slow.

All of this, along with workarounds for the problem, is well-documented
here:
http://www-128.ibm.com/developerwork...ott/index.html

I see you're using ADODB; we really need to get the ibm_db2 extension
for PHP (http://php.net/ibm_db2) supported in ADODB, because until
that's available anybody using ADODB to connect to DB2 through Unified
ODBC is going to think that the database is the bottleneck. The ibm_db2
extension does things right (including BLOB support, defaulting to
forward-only cursors but enabling you to use scrollable cursors on a
statement by statement basis, and support for OUT/INOUT parameters in
stored procedures).

Dan

Nov 24 '05 #5
Larry:

Retrieval of LOBs and (I believe) LONG VARCHARs in scrollable cursors
is not supported by DB2, ergo warnings or errors are to be expected
with Unified ODBC. :(

Dan

Nov 25 '05 #6

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

Similar topics

0
by: krystoffff | last post by:
For the following query, I have a little problem ... First, I have to rewrite several times the same query because the alias are not recognised in the same query ( I got an error when I try to...
0
by: Rey | last post by:
table prizes (l_playerid, s_playerid, l_prize, s_prize) 1 - 1 - 500 - 350 2 - 1 - 650 - 245 1 - 2 - 500 - 65 2 - 2 - 150 - 85 3 - 3 - 95 - 125 5 - 2 - 350 - 205 table players (playerid,...
2
by: Paul Sieloff | last post by:
I am trying to conditionally create a stored procedure in a Query Analyzer script. When I have the CREATE PROCEDURE statement by itself in the script, it compiles and runs ok. Once I put a...
4
by: bhargav.desai | last post by:
Hello Gurus, I need help! I have two table, tblCurrent and tblPrevious. What I want to join the tables, and create a new table that have matching records from both the tables, plus this new...
6
by: ngweixiong | last post by:
Hi, I have 2 query in Ms Access. Query1: Summary of Invoice (ZEAVI) Fields: Biling doc Count of biling doc Date Order number Count of Order number
3
by: silverstriip | last post by:
Query Join Properties I have 2 tables. one (Data_Participant) has all of the data on individual participants. the other (Data_Main) has the data of how they participated per year. my...
1
by: ajcolburn | last post by:
Hi there, I'm writing a very simple shopping cart for a friend, but I'm confusing myself with the SQL required to return postage costs for each product in the cart, at checkout. It's probably...
26
by: JC2710 | last post by:
HI I have 2 tables ProductType and Sales. I am trying write a query which gives me a summary of Product Types and Sales for each Product. Product.....................Sales ...
7
by: nofear | last post by:
I have a table with 2 fields where one has duplicates and the other does not something like this: ID field1 field2 1 A A 2 A B 3 A C...
11
by: termitebe | last post by:
Hi being the only (somewhat) computerliterate person in my department I have inherited an access 2000 Db wich contains 2 tables: (strangely reporting that access is not one of the programs I am...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
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...

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.