Hello
@MOJGAN SAMIFANNI,
yae@t590:~$ uname -a
Linux t590 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
This is an LTS (long term support) version, which should be soon be supported by Db2, if we refer to history :-).
db2prereqcheck only checks for a minimal version of the operating system.
More seriously the issue is due to the Db2 ODBC driver or unixODBC driver manager.
I can help you narrow the problem, if you share how to configure tracing so that you can figure out where the issue is.
Regards.
Thanks.
------------------------------
Yves-Antoine Emmanuelli
------------------------------
Original Message:
Sent: Wed September 02, 2020 01:27 PM
From: MOJGAN SAMIFANNI
Subject: unixODBC support for NULL values on Linux
Hi @Yves-Antoine Emmanuelli,
Can you please also provide the OS level for Ubuntu that you ate testing on?
Original note mentions Unbutu 20.04 and unfortunately this is not supported OS level yet by Db2.
------------------------------
MOJGAN SAMIFANNI
Original Message:
Sent: Wed September 02, 2020 12:57 PM
From: Yves-Antoine Emmanuelli
Subject: unixODBC support for NULL values on Linux
Hello @MOJGAN SAMIFANNI,
With the latest image (2020-09-01), the last query (returning COMM only) returns a slightly different result:
SQL> select COMM from DB2INST1.STAFF where COMM is NULL
+----------+
| COMM |
+----------+
| �l� |
| �l� |
| �l� |
| �l� |
| �l� |
| �l� |
| �l� |
| �l� |
| �l� |
| �l� |
| �l� |
+----------+
SQLRowCount returns -1
11 rows fetched
Regards.
------------------------------
Yves-Antoine Emmanuelli
Original Message:
Sent: Sat August 29, 2020 09:15 AM
From: Yves-Antoine Emmanuelli
Subject: unixODBC support for NULL values on Linux
... and if you specify only COMMin the result set:
SQL> select COMM from DB2INST1.STAFF where COMM is NULL
+----------+
| COMM |
+----------+
| PQU |
| PQU |
| PQU |
| PQU |
| PQU |
| PQU |
| PQU |
| PQU |
| PQU |
| PQU |
| PQU |
+----------+
SQLRowCount returns -1
11 rows fetched
------------------------------
Yves-Antoine Emmanuelli
Original Message:
Sent: Mon August 24, 2020 05:16 PM
From: Yves-Antoine Emmanuelli
Subject: unixODBC support for NULL values on Linux
Hello Mojgan,
My test was done on latest beta:
yae@t590:~$ db2level
DB21085I This instance or install (instance name, where applicable:
"db2inst1") uses "64" bits and DB2 code release "SQL11055" with level
identifier "0606010F".
Informational tokens are "DB2 v11.5.5.0", "s2006111000", "DYN2006111000AMD64",
and Fix Pack "0".
Product is installed at "/opt/ibm/db2/V11.5".
Regards.
------------------------------
Yves-Antoine Emmanuelli
Original Message:
Sent: Mon August 24, 2020 02:30 PM
From: MOJGAN SAMIFANNI
Subject: unixODBC support for NULL values on Linux
Hi @Yves-Antoine Emmanuelli
Please note that Ubuntu 20 supported OS in Db2 11.5.x stream. Also can you please provide your db2level.
Regards:
Mojgan Samifanni
------------------------------
MOJGAN SAMIFANNI
Original Message:
Sent: Fri August 21, 2020 10:59 AM
From: Yves-Antoine Emmanuelli
Subject: unixODBC support for NULL values on Linux
Hello,
I have a problem returning NULL values to an unixODBC connection.
Configuration :
Up to date Ubuntu 20.04
DB2 11.5.5.0 beta
unixODBC 2.3.7 packaged in Ubuntu 20.04 distribution:
yae@t590:~$ odbcinst -j
unixODBC 2.3.7
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
FILE DATA SOURCES..: /etc/ODBCDataSources
USER DATA SOURCES..: /home/yae/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8
yae@t590:~$ cat /etc/odbcinst.ini
[Db2]
Description = Db2 Driver
Driver = /home/db2inst1/sqllib/lib/libdb2o.so
fileusage=1
dontdlclose=1
yae@t590:~$ cat /etc/odbc.ini
yae@t590:~$ cat /home/yae/.odbc.ini
[ODBC Data Sources]
SAMPLE = Db2 11.5 Driver
[SAMPLE]
Driver = /home/db2inst1/sqllib/lib/libdb2.so
Description = Sample Db2 ODBC Database
And now, testing with isql, an interactive command line tool included in unixodbc package:
yae@t590:~$ isql SAMPLE
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL> select ID, COMM from DB2INST1.STAFF where ID<100
+-------+----------+
| ID | COMM |
+-------+----------+
| 10 | 10 |
| 20 | 612,45 |
| 30 | 30 |
| 40 | 846,55 |
| 50 | 50 |
| 60 | 650,25 |
| 70 | 1152,00 |
| 80 | 128,20 |
| 90 | 1386,70 |
+-------+----------+
SQLRowCount returns -1
9 rows fetched
SQL> select ID, COMM from DB2INST1.STAFF where ID<100 and COMM is NOT NULL
+-------+----------+
| ID | COMM |
+-------+----------+
| 20 | 612,45 |
| 40 | 846,55 |
| 60 | 650,25 |
| 70 | 1152,00 |
| 80 | 128,20 |
| 90 | 1386,70 |
+-------+----------+
SQLRowCount returns -1
6 rows fetched
SQL> quit
yae@t590:~$
It looks like the value of ID is returned for COMM where COMM values are NULL.
Did I miss anything in the configuration ?
Thanks for your help!
Regards.
------------------------------
Yves-Antoine Emmanuelli
------------------------------
#Db2
#Db2EarlyAccessProgram(EAP)Forum