Results 1 to 8 of 8
  1. #1
    Join Date
    Aug 2009
    Posts
    1

    Question Unanswered: Cannot convert to number

    Hi all,

    I am using Coldfusion to present DB2 data. My problem is that some of data is readable and some is not. I tried #ToString(encoding)# and REPLACE and still no luck. The ToString will only change the characters from boxes to something else. The REPLACE has not done anything. I am running my queries through Coldfusion and not at a DB2 console. Is there a quick fix to this? Hopefully someone out there has seen this.

    Thanks in advance,

    DJ Khalif

  2. #2
    Join Date
    Apr 2008
    Location
    Iasi, Romania
    Posts
    561
    Provided Answers: 2
    Florin Aparaschivei
    DB2 9.7, 10.5 on Windows
    Iasi, Romania

  3. #3
    Join Date
    Jan 2009
    Location
    Chicago
    Posts
    11

    Question Cannot convert to number

    I tried CAST and DECIMAL and neither worked. Do you have an example? Also, I have a column name that contains # and when I write the string, Coldfusion considers this an expression.

  4. #4
    Join Date
    Apr 2008
    Location
    Iasi, Romania
    Posts
    561
    Provided Answers: 2
    The link above is for DB2 LUW 9.5

    Use this link to choose the Information center accordingly to your version:
    IBM - DB2 database product documentation
    Florin Aparaschivei
    DB2 9.7, 10.5 on Windows
    Iasi, Romania

  5. #5
    Join Date
    May 2009
    Posts
    508
    Provided Answers: 1
    djkhalif, What version of DB2 and what operating system are you using?

    Can you give an example of the data before the conversion and what you want it to look like after?
    Last edited by Stealth_DBA; 08-04-09 at 09:11.

  6. #6
    Join Date
    Jan 2009
    Location
    Chicago
    Posts
    11

    Question Cannot convert to number

    Unfortunately, I can't see the data or the datatype pre-processing. In two different dbs I get funky data. If I use #ToString(column)# I get squares. Here is Access VB version: Select A.ORDNO, A.FITEM " _
    & "FROM AMFLIBQ.MOMAST A INNER JOIN CD_COMDTA.DOMLP100 B ON (A.FITEM = B.LPITM#) " _
    & "Where A.ORDNO = 'M" & strWorkOrder & "' And B.LPSTAT = 'A'"

  7. #7
    Join Date
    Jan 2009
    Location
    Chicago
    Posts
    11
    ByteArray objects cannot be converted to strings. Without ToString.

  8. #8
    Join Date
    Jan 2009
    Location
    Chicago
    Posts
    11
    utf-8 cannot be converted to a number. These are the error messages that I get.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •