Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2011

    Unanswered: sql0420n: invalid character in string arg of DECFLOAT

    Hi I am getting the following error:

    SQL0420N: invalid character found in the character string argument of function DECFLOAT.

    The querey:

    select distinct a.person, a.score1 + a.score2 as tot_score from
    (select distinct b.person,
    case when b.result1 < 50 then 0
    else '2' end as score1,
    case when b.result2 < 50 then 0
    else '4' end as score2
    (select distinct person, result1,result2 from test)b
    group by b.person,b.score1,b.score2,
    case when b.result1 < 50 then 0
    else '2' end,
    case when b.result2 < 50 then 0
    else '4' end
    ) a
    the problem occurs with:

    a.score1 + a.score2 as tot_score, in the first line

    how do i resolve this? I can't see where there are any casting issues here....

    Thanks very much.

  2. #2
    Join Date
    Jan 2003
    Provided Answers: 5
    Why are you using a numeric value for the THEN clause of the CASE and a string for the ELSE?


  3. #3
    Join Date
    Jun 2003
    Toronto, Canada
    Provided Answers: 1
    By the way, the query you claim to be running has a syntax error in it. You may want to show us the actual query (along with the actual table data).
    "It does not work" is not a valid problem statement.

  4. #4
    Join Date
    Jul 2011
    Andy - thanks for the right answer. changed them all to ints and resolved the issue!

    n_i - unfortunately all the work i do is in a secure gateway so i can't bring neither querey or data out. it's not perfect, but the only way i can get my problem across is to write out a simplified script and hope someone sees where i have gone wrong so i can change the real code.

Posting Permissions

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