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 > Join Number field to String field problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-08-09, 11:20
newer newer is offline
Registered User
 
Join Date: Sep 2003
Posts: 32
Join Number field to String field problem

I have table X, Y, I want to join A (number) to B (String) to get C
SELECT C
FROM X, Y
WHERE A=INTEGER(B)

I get an error: [DB2/400 SQL] SQL0420- Character in CAST argument not valid.

Thanks
Reply With Quote
  #2 (permalink)  
Old 04-08-09, 11:58
dav1mo dav1mo is offline
Registered User
 
Join Date: Dec 2007
Location: Richmond, VA
Posts: 782
Apparently there is some non-numeric data in B. You could try the reverse as well strip(digits(a),l,'0') = b

Dave
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