LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  New to lavaStorm , SQL DB question

    Employee
    Posted 03-12-2015 16:07

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: felfajar

    Hi all,

    I am quite new to LS, so apologies if this has been answer in the past. My question is I have a filter node with some accounts I need to look at, now what I want is to be able to reference those account in a sql statement
    Eg

    select *
    from DB
    where account_no =1
    or account_no = 2
    or account_no = 3
    or account_no = 4

    so what I want is to be able to retrieve all the accounts on the where statement instead of using the or operator, as they are actually thousands of accounts, I was thinking maybe outputing the filter into a excel file and read from it, but i could not find a solution with that either, so any possible way to do this without having to copy paste all the time as is very time consuming.

    Thanks in Advance


  • 2.  RE: New to lavaStorm , SQL DB question

    Employee
    Posted 03-12-2015 17:46

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: ryeh

    The SQL statement is throwing me off. Are you trying to filter data that you have already pulled into Lavastorm? If so, could we filter account numbers by a certain range? So something like:

    emit *
    where account_no >=1 and account_no <=1000


  • 3.  RE: New to lavaStorm , SQL DB question

    Employee
    Posted 03-12-2015 17:58

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: felfajar

    Originally posted by: ryeh
    					

    The SQL statement is throwing me off. Are you trying to filter data that you have already pulled into Lavastorm? If so, could we filter account numbers by a certain range? So something like:

    emit *
    where account_no >=1 and account_no <=1000
    HI

    thanks for your quick reply!!! I wont be able to do what you sugggested, as accounts are not in order and not consecutive either and I have 11k accounts I have to check, another work around you might be able to suggest? what I normally do is to paste all the accounts with the or statement, so what I want to knw is there any way that on the sql I can reference them, or perhap reference them from an excel file or text file, but if so, how would I write the sql statement?

    Thanks once again


  • 4.  RE: New to lavaStorm , SQL DB question

    Employee
    Posted 03-12-2015 18:44

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: stonysmith

    Switch over and use DbExecute:

    for Oracle:

    query="select * from table where account_no = :1"
    sqlSelect(1,query,account_no)


    for some other databases:

    query="select * from table where account_no = ?"
    sqlSelect(1,query,account_no)