Solved

Data Format returned from a query

Posted on 2006-06-14
3
377 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Suggested Solutions

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…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

734 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