Solved

Data Format returned from a query

Posted on 2006-06-14
3
375 Views
Last Modified: 2008-02-26
I am using a client access odbc driver to access a db2 database (Driver={Client Access ODBC Driver (32-bit)}).  My result set returns ???????????????@ for one field in the query.  I can run the same query in sql workbench using a  (com.ibm.as400.access.AS400JDBCDriver) driver and it works just fine.  The only way to return the field that I need is to cast the field as numeric, but some of the records contain alphanumeric data.  

Other fields in the same table return with the same data type return the correct format.

Thanks in advance

0
Comment
Question by:gdlp2004
3 Comments
 
LVL 50

Expert Comment

by:Lowfatspread
ID: 16908057
what is the underlying column data type?

can you post the definition of the table...?

which OS and version of UDB are you using?
0
 
LVL 27

Accepted Solution

by:
tliotta earned 500 total points
ID: 16908096
gdlp2004:

> but some of the records contain alphanumeric data

Whoever is in charge of that file (table) needs to fix it. Either the field (column) is defined incorrectly or there is invalid data in it. If there is invalid data, e.g., alphanumerics in a numeric column, there is some process that is allowing bad data to get inserted/updated. Unpredictable results will happen eventually.

The IBM driver is indicating that data is not following the rules of the file definition. You can use another driver that doesn't care, but you can't predict what results might come tomorrow or next week or whenever the worst possible time might arrive.

Tom
0
 
LVL 7

Expert Comment

by:sachinwadhwa
ID: 16909447
cast it to CHAR or VARCHAR

I think it could be a codepage issue or is your field "for bit data" ?
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question