Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2008
    Posts
    2

    Unanswered: why the below db2 sql code is giving parsing error at case expression?

    [RTL_PRT_PLS].[EY_ID] = [RTL_P_P_STG].[EY_ID]
    AND
    [RTL_PRT_PLS].[AA_ID] =[CDW_RTL_P_P_STG].[AA_ID]
    AND
    [RTL_PRT_PLS].[PL_ID] =[RTL_P_P_STG].[PL_ID]
    AND
    ((char([RTL_PRT_PLS].[EXPR_DTE] ) >= CASE WHEN @PROMPT ('Enter Date (format YYYY-MM-DD) or * for Current Date','C',,,) = '*'
    THEN '9999-12-31' END )
    OR @PROMPT('Enter Date (format YYYY-MM-DD) or * for Current Date','C',,,) BETWEEN char([RTL_PRT_PLS].[EFF_DTE] ) and
    char(.[RTL_PRT_PLS].[EXPR_DTE] ))

    can anyone able to explain 1) why the '*' is used 2) why there are multiple comms after 'C' and 3) what is that @prompt ?

    many thanks in advance...

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    It is you SQL, you would have to tell us. Where is this coming from? Also what DB2 version and OS?

    Andy

  3. #3
    Join Date
    Nov 2004
    Posts
    1,427
    Provided Answers: 4
    All this
    Code:
    [RTL_PRT_PLS].[EY_ID]
    reminds me of MS access.
    With kind regards . . . . . SQL Server 2000/2005/2012
    Wim

    Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2.
    Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages

  4. #4
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    What is this "@PROMPT(... , , , )" thing? This is not a valid SQL expression (neither by the accounts of the SQL standard nor DB2).
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  5. #5
    Join Date
    Feb 2008
    Posts
    2
    stolze,

    you are right...the problem is with @prompt, which we replaced with #prompt
    and removed those multiple commas...
    actually i didn't wrote the code...it's a request from the customer !

Posting Permissions

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