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 > Converting string to decimal - error

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-07-08, 02:15
chesl73 chesl73 is offline
Registered User
 
Join Date: Oct 2008
Posts: 19
Converting string to decimal - error

Hi all,

I have a stored proc that takes in parameters (from_threshold_value varchar(10), to_threshold_value(10). These need to be strings for another reason I won't go into.
What I have is a HAVING clause in which I want to restrict the fact Aggr field based on the from and to thresholds the user types in.

However, when I run it, I get the errorQL0420N - Invalid character found in a character string argument of the function DECIMAL.

I don't understand why I'm getting this as the character string is typed in as it's a prompt so it's not as if I'm typing in something that can't be converted to a decimal. I've also tried using CAST as well.

A simplified part of the SQL is below, any ideas would be appreciated. Thanks.

HAVING
SUM(COALESCE(ODW.FACT_EVENT.TOTAL_EVENT_IMPACT,0)) < DECIMAL(LTRIM(RTRIM(to_threshold_value)),12,2)
Reply With Quote
  #2 (permalink)  
Old 10-07-08, 10:29
tonkuma tonkuma is offline
Registered User
 
Join Date: Feb 2008
Location: Japan
Posts: 2,193
What character string did you type in?
Reply With Quote
  #3 (permalink)  
Old 10-07-08, 18:10
chesl73 chesl73 is offline
Registered User
 
Join Date: Oct 2008
Posts: 19
Actually, just figured out the problem.
It was my own daft logic!

Thanks for the reply anyway.

Last edited by chesl73; 10-07-08 at 19:29.
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