?
Solved

Data Format returned from a query

Posted on 2006-06-14
3
Medium Priority
?
382 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 2000 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

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

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

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…
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…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

770 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