php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25112 SQLExecDirect error with CLOB column in SQL
Submitted: 2003-08-16 23:39 UTC Modified: 2003-08-20 14:22 UTC
From: gms08701 at yahoo dot com Assigned:
Status: Closed Package: ODBC related
PHP Version: 4CVS-2003-08-16 (stable) OS: windows 2000 sp4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: gms08701 at yahoo dot com
New email:
PHP Version: OS:

 

 [2003-08-16 23:39 UTC] gms08701 at yahoo dot com
Description:
------------
Using w2k sp4, mdac 2.8, ibm db2 8.1.3, windows native ODBC.
Trying to do a select with a table join with a CLOB column in the select list, is not executing.
If selecting a CLOB column without table joins executes correctly.

The very same sql (with the table joins) works correctly via ibm db2's command line.

You can get a bit more detail at http://dbforums.com/showthread.php?postid=3247451

Reproduce code:
---------------
<?php

$conn = odbc_connect ('IBM DB2', 'user', 'pass');

//$sql = "select options from NULLID.config where name = 'foo'";
$sql = "SELECT c.options FROM NULLID.config c, NULLID.modules m WHERE c.name = 'foo' AND c.name = m.name";
$result = odbc_exec( $conn, $sql );
odbc_result_all($result);

?>

Expected result:
----------------
Warning: odbc_exec(): SQL error: [IBM][CLI Driver][DB2/NT] SQL0270N Function not supported (Reason code = "63"). SQLSTATE=42997 , SQL state 42997 in SQLExecDirect in C:\Inetpub\wwwroot\z.php on line 7


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-08-17 00:49 UTC] gms08701 at yahoo dot com
I've been over that page already that you posted, but Im not sure how it applies.
According to the code snippet I provided, if I comment out line 6 and uncomment line 5, I can then select the CLOB column via php.
So even though the errors may be the same, the circumstances between this bug report and the page you provided aren't.
Plus, the SQL works via DB2's command line, and not with php, so I don't think its a DB2 problem.
So Im going to reopen it.
If you still feel that its bogus, reset it as such, and Ill accept it as so.
Thanks
 [2003-08-17 12:22 UTC] php at jschreiber dot com
have you tried "SELECT [...] FOR READ ONLY"? 
all cursors are dynamic by default and there cursors are no 
longer supported in db/2 v8.1. 
 
have you read ibm's article on 
http://www7b.software.ibm.com/dmdd/library/techarticle/0301liu/0301liu.html 
? it conains a lot of useful information on blob handling with db2 
and php.
 [2003-08-17 13:19 UTC] gms08701 at yahoo dot com
Well Ill have to say, that was an excellent read.
Appending 'FOR READ ONLY' after SELECT statements, seem to have circumvented the problem, and improve performance :)
Thanks for the tip.
For the PHP ODBC developers, the article made a few references to proposed fixes/workarounds.

Page 17, first 2 paragraphs, talks about how PHP ODBC and DB2 talk, doing convertions.  If its possible to have a switch so one can change the nature of a cursor would be great.

And starting from the second to last paragraph on page 19 talks about datatypes that aren't supported by PHP ODBC, and a proposed fix.

So Im going to continue fixing some more SQL, and see how the script does, but for now, it seems good.
Sniper, I leave the bug status up to your descretion.
Thanks
 [2003-08-20 13:22 UTC] kalowsky@php.net
yes I know about the cursor issue, and have been working on a solution.  Just lost time to work on it.  Marking this as closed as it's a symantec thing.

For what it's worth I do have the patch that Clara Liu speaks about in the forementioned article on DB2, and would enjoy having others test it.
 [2003-08-20 14:22 UTC] gms08701 at yahoo dot com
You can contact me at my email address about testing the patches.
Thanks.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 27 17:01:34 2024 UTC