Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
jubarrosor
Partner Ambassador
Partner Ambassador

Db2 format problems

Hi,

I have an issue when I read data from a db2.

I'm using an odbc connection to db2:

Screenshot_2.jpg

and I'm reading datas using a "select *..." without any transformation:

Screenshot_3.jpg

The problem is:

There is a data changed, his code has been modified in one character: xxxxxxEx for xxxxxxxDx so there's two register with the same code (because the code is PK in the source table).

Could you help me? 😞

Thak you!

Best Regards!

14 Replies
ashfaq_haseeb
Champion III
Champion III

I think we miss something

Contact me on Skype

myskypeID : ashfaqhaseeb

jubarrosor
Partner Ambassador
Partner Ambassador
Author

Hi deepak,

The data are changed:

in source there are two codes in column IDEQRS:

130828543D3

130828543E3

in target:

both register are the same value 130828543D3 in column IDEQRS.

Best Regards!

jubarrosor
Partner Ambassador
Partner Ambassador
Author

Hello,

I don't know the problem yet but i have a solution.

If I concatenate a '$' to the column IDEQRS all codes are reading well.

I think that the odbc connection reads the code 130828543E3 like a number (but the column is alfanumeric) and this is the reason because the results are wrong (if I concatenate '$' the column are readed like an alfanumeric).

Is it a bug?

Thank you and sorry for my english!

Best Regards!

PS: Thank you very much Ashfaq! but I haven't skype in my job.

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

No, its not a bug. Here's what is happening:

  • Both 1234E5 and 1234D5 (for example) are valid floating point number forms (E is single precision, D is double precision). QV considers them to be equal because they are loaded as numbers
  • QV uses the first row to determine the display format. If the row contains 1234D5 it will be formatted as such. When QV reads the second row (containing 1234E5), it applies the same format, hence 1234D5.

To get around this, you must tell QV to use a text load. This what your workaround is in effect doing, but you can do it simply with

     LOAD Text(IDEQRS) As IDEQRS,

          ....

     ;

     SQL SELECT IDEQRS, .....

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jubarrosor
Partner Ambassador
Partner Ambassador
Author

Thank you Jonathan!!!!!