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.  If statement with output

    Employee
    Posted 10-21-2015 08:47

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

    Originally posted by: sozdemir

    Hi all,

    I am trying to incorporate an if statement with output, the below is what I have tried so far:

    var1 = sqlSelect('sql_statement') #this returns only one field and one value

    output "output1" {
    if len(var1) > 0
    then
    "some_message"
    else
    "some_other_message"
    }

    With the above if statement, I keep getting "Unexpected token (if) at line..." error.

    Any advice is appreciated.

    Thanks


  • 2.  RE: If statement with output

    Employee
    Posted 10-21-2015 08:51

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

    Originally posted by: stonysmith

    The text you have "some_message" is not assigned to a column name..

    var1 = sqlSelect('sql_statement') #this returns only one field and one value

    msg = if len(var1) > 0 then "some_message" else "some_other_message"

    output "output1" {
    emit msg as Message
    }