Solved

Data Format returned from a query

Posted on 2006-06-14
3
365 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
DB2 what is copybook? 4 521
replication of DB2 to MS SQL 43 366
as400 interactive sql phone number search 7 118
AS400 Forms 9 97
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 (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

705 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now