If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Cannot convert to number

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-03-09, 23:28
djkhalif djkhalif is offline
Registered User
 
Join Date: Aug 2009
Posts: 1
Question 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
Reply With Quote
  #2 (permalink)  
Old 08-04-09, 04:42
aflorin27 aflorin27 is offline
Registered User
 
Join Date: Apr 2008
Location: Iasi, Romania
Posts: 317
__________________
Florin Aparaschivei
Iasi, Romania
Reply With Quote
  #3 (permalink)  
Old 08-04-09, 07:43
kabaari kabaari is offline
Registered User
 
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.
Reply With Quote
  #4 (permalink)  
Old 08-04-09, 08:00
aflorin27 aflorin27 is offline
Registered User
 
Join Date: Apr 2008
Location: Iasi, Romania
Posts: 317
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
Iasi, Romania
Reply With Quote
  #5 (permalink)  
Old 08-04-09, 08:06
Stealth_DBA Stealth_DBA is offline
Registered User
 
Join Date: May 2009
Posts: 472
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 08:11.
Reply With Quote
  #6 (permalink)  
Old 08-04-09, 08:17
kabaari kabaari is offline
Registered User
 
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'"
Reply With Quote
  #7 (permalink)  
Old 08-04-09, 08:37
kabaari kabaari is offline
Registered User
 
Join Date: Jan 2009
Location: Chicago
Posts: 11
ByteArray objects cannot be converted to strings. Without ToString.
Reply With Quote
  #8 (permalink)  
Old 08-04-09, 08:40
kabaari kabaari is offline
Registered User
 
Join Date: Jan 2009
Location: Chicago
Posts: 11
utf-8 cannot be converted to a number. These are the error messages that I get.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On