Quantcast
Channel: SCN: Message List - SAP Adaptive Server Enterprise (SAP ASE) for Custom Applications
Viewing all articles
Browse latest Browse all 3587

Problem with NULL values using Sybase ODBC driver in Linux

$
0
0

Hi,

 

I am accessing a Sybase ASE 15.7 database using Sybase ASE 16.0 ODBC driver on Ubuntu 14.04.

 

I have a strange problem with fetching NULL values. At first I noticed the problem with a Python script,

but the problem remains the same when using the isql command line tool that comes with unixodbc

package. The isql command line tool can be used to access the Sybase ASE database via ODBC driver

and test if the ODBC driver configuration is valid.

 

The problem can be tested with a simple select statement with a column which does not have a value

i.e. is NULL.

 

As you can see the ISNULL function is used here to make sure the column customer_segment is NULL:

 

SQL> select ISNULL(customer_segment, 'has no value') from test_table where id = 50

+-------------+

|             |

+-------------+

| has no value|

+-------------+

SQLRowCount returns -1

1 rows fetched

 

 

SQL> select language, customer_segment from test_table where id = 50

+---------+-----------------+

| language| customer_segment|

+---------+-----------------+

| FI      | FI              |

+---------+-----------------+

SQLRowCount returns -1

1 rows fetched

SQL>

 

Has anyone of you seen this before? Is this a known problem?

 

Any help would be appreciated.

 

Thanks is advance,

Kari


Viewing all articles
Browse latest Browse all 3587

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>