Require Solution SQL0104 error

Tags:
AS/400
SQLRPGLE
I am trying to compile the below SQLRPGLE code but getting an error SQL0104 because of IN function used with comma. However, the same code is running fine in different server.
Source Code:
H DftActGrp(*No) ActGrp(*Caller)   
 /Free                             
  Exec SQL                         
  Set Option Commit=*None;         
                                   
  Exec SQL                         
  INSERT INTO QTEMP/WKMT5TMP       
  SELECT * FROM DEVSHA/WKMT5TMP  
    WHERE MONTH in(1,2,3,4,5);   
                                   
  *Inlr = *On;                     
 /End-Free
             
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

When using a list of numeric values separated by comma’s you should use blanks to make a separation. in(1 , 2 , 3 , 4 , 5)
How else would you try to select 1,2 value ?

Discuss This Question: 7  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • ToddN2000
    How is MONTH defined?
    131,645 pointsBadges:
    report
  • Mdshadabalam

    @pdraebel Thanks for your response. Even space is not working out.

    As I mentioned in the question that the same query is perfectly working fine in different server. 

    other way i try that same query i ran in RUNSQL and get the same error. Good news here that i am able to fix the error by changing the decimal parameter from comma to periods. in the sameway i am thinking that at program level need to change somethink like that.

     

     

    130 pointsBadges:
    report
  • Mdshadabalam

    @ToddN2000 thank for your response.

    Month is NUMERIC 2.

    130 pointsBadges:
    report
  • ToddN2000
    Then follow pdraebels' suggestion and separate them with a blank as well. The reason is in this example number in(1,200), a single value or 1 values 1 and 200. Try that extra space.
    131,645 pointsBadges:
    report
  • philpl1jb

    You are missing a space

    WHERE MONTH in(1,2,3,4,5)

    in( .. is interpreted as some function named in

    in ( .. is interpreted as in the following list

    There must be a space between in and (

    54,090 pointsBadges:
    report
  • ToddN2000
    Nice catch philpl1jb. Not only did I miss the space after the "in", I did the same thing in my reply.
    131,645 pointsBadges:
    report
  • Mdshadabalam
    Thanks Philpl1jb!!! its working perfectly after providing the space after comma. Thanks a lot once again...
    130 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: