SunQuest
           DB2 Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDB2 Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old August 15th, 2007, 05:21 PM
SimonJ621 SimonJ621 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2006
Posts: 40 SimonJ621 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 h 50 m
Reputation Power: 2
SELECT FROM DB2 with PHP - Invalid value specified for keyword "CONCURRENCY" in sta

I am trying to select from a DB2 database with PHP. To my knowledge, the connection is being made, but the select statement won't run. The following is the error I receive:

Quote:
Warning: odbc_exec() [function.odbc-exec]: SQL error: [IBM][CLI Driver][DB2/AIX64] SQL0644N Invalid value specified for keyword "CONCURRENCY" in statement "<ATTRIBUTE-STRING>". SQLSTATE=42615 , SQL state 42615 in SQLExecDirect in C:\wamp\www\db.php on line 24


I can't find much help online, which is why I am posting here. Any help would be much appreciated as I have never attempted to use DB2. Following is my PHP code:

PHP Code:
<?php 

function dbconnect($verbose) {
    
$dbname "**";
    
$username "**";
    
$password "**";
    
    
$dbconn odbc_pconnect($dbname$username$password);
    
    if ((
$verbose == TRUE) && ($dbconn == )) {
        echo(
"connection to database failed.");
        
$sqlerror odbc_errormsg($dbconn);
        echo  
"<br /><br />".$sqlerror."<br /><br />";
    }
    
    return(
$dbconn);
}


function 
display($dbconn) {
    
$select_stmt "SELECT * FROM blabla";

    if (
$dbconn != 0) {
        
$result odbc_exec($dbconn$select_stmt);
        if (
$result == 0) {
            echo 
"SELECT statement failed.<br />";
            
$sqlerror odbc_errormsg($dbconn);
        }
        else {
            
odbc_result_all($result);
        }
    }
}

$verbose TRUE;
$dbconn dbconnect($verbose);

display($dbconn);


?>



Thank you for all the help,

Jason
--------------------------
http://www.elefoo.com/
http://www.blackspyraldancer.com/

Reply With Quote
  #2  
Old August 17th, 2007, 07:25 AM
SimonJ621 SimonJ621 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2006
Posts: 40 SimonJ621 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 h 50 m
Reputation Power: 2
I used db2_connect instead of the odbc functions and it worked find. The following code worked:

PHP Code:
 $conn db2_connect($dbname$username$password);

if (
$conn) {
   
$sql "SELECT * FROM Table1";
   
$stmt db2_prepare($con$sql);
   
db2_execute($stmt);

   
$rows = array();
   
$i 0;

   while (
db2_fetch_row($stmt)) {
      
$rows[$i] = db2_result($stmt0);
      echo 
$rows[$i]."<br />";
      
$i++;
   }
}
else {
   echo 
"Connection failed. <br />";
   echo 
db2_conn_errormsg();



Thanks again.

Jason
------------------------------
http://www.elefoo.com/
http://www.blackspyraldancer.com/

Reply With Quote
  #3  
Old August 20th, 2007, 03:59 AM
valined's Avatar
valined valined is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2004
Location: Brussels
Posts: 609 valined User rank is Captain (20000 - 30000 Reputation Level)valined User rank is Captain (20000 - 30000 Reputation Level)valined User rank is Captain (20000 - 30000 Reputation Level)valined User rank is Captain (20000 - 30000 Reputation Level)valined User rank is Captain (20000 - 30000 Reputation Level)valined User rank is Captain (20000 - 30000 Reputation Level)valined User rank is Captain (20000 - 30000 Reputation Level)valined User rank is Captain (20000 - 30000 Reputation Level)valined User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 17 h 17 m 28 sec
Reputation Power: 231
Question

Quote:
Originally Posted by SimonJ621
Warning: odbc_exec() [function.odbc-exec]: SQL error: [IBM][CLI Driver][DB2/AIX64] SQL0644N Invalid value specified for keyword "CONCURRENCY" in statement "<ATTRIBUTE-STRING>". SQLSTATE=42615 , SQL state 42615 in SQLExecDirect in C:\wamp\www\db.php on line 24

What statement is at line 24 in db.php?
__________________
"Problem" is just a bleak word for challenge. -- Richard Fish
Javalanche

Reply With Quote
  #4  
Old August 20th, 2007, 08:56 AM
SimonJ621 SimonJ621 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2006
Posts: 40 SimonJ621 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 h 50 m
Reputation Power: 2
Hi Valined, I changed the script to be db2 specific (which worked better than the odbc connection functions) but I believe line 24 was:

PHP Code:
 $result odbc_exec($dbconn$select_stmt); 


Jason
----------------------------------
http://www.elefoo.com/
http://www.blackspyraldancer.com/

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDB2 Development > SELECT FROM DB2 with PHP - Invalid value specified for keyword "CONCURRENCY" in sta


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway