|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75926 DB2 SQL: column name with character "§" returns an error.
Submitted: 2018-02-06 14:27 UTC Modified: -
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: shlomovanunu at roguewave dot com Assigned:
Status: Open Package: ibm_db2 (PECL)
PHP Version: Irrelevant OS: IBM i v7.x
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2018-02-06 14:27 UTC] shlomovanunu at roguewave dot com
Issue with accessing a legacy db2 database file/table with db2 extension, the table contains column names using the character section code "§". All works on the IBM i green screen and legacy code.
The character is supported with IT language feature QSYS2932.

The problem is when using the select statement with the individual field names...
if called with '* select' - it works:
SELCT * from qgpl.testpf1  - works 
SELECT D§FDT, D§FMODU from qgpl.testpf1 - does not work
CREATE TABLE qgpl.testpf1 (
  D§ID   VARCHAR(2),

Test script:

$database = 'XXXXX';
$user = 'XXXXXX'; 
$password = 'XXXXXX';

//Establish connection to database
$conn = db2_pconnect ($database, $user, $password);
if ($conn === false) {
   die("FAIL : Failed to connect to data base server: $database, with user name :  $user and password : $password");
else {
   echo "Connection established to database: $database ";
   echo  "<br /><b>The result of the query is:</b>\n" ;
   //Statement does not work
   $sql = "SELECT D§ID, D§NAME FROM QGPL.testpf1";

   //Statement works
//$sql = "SELECT * FROM QGPL.testpf1";

$stmt = db2_prepare($conn, $sql);
$result = db2_execute($stmt);

 if ($result) {
        echo "Successfully called." . "</br>";
   /*while (($row = db2_fetch_assoc($stmt)) !== false) {
                    echo "</br>";
               } */
while ($row = db2_fetch_assoc($stmt)) {
	echo "<pre />" ;
   printf ("%-16s %-32s\n", 
       $row['D§ID'], $row['D§NAME']);
} }



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-02-27 15:49 UTC] shlomo dot vanunu at roguewave dot com
A workaround for other PECL users. 

Change the PHP script to use the character  "§" instead of "§" . 

(This works on other Italian customer system with CCSID 1144) 
$sql = "SELECT D§ID, D§NAME, D§MEMO   FROM QGPL.testpf1";
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 13 00:01:28 2024 UTC