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.  Bypass a node

    Employee
    Posted 10-02-2015 09:58

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

    Originally posted by: karennap

    Hi all, I have a DB Execute node which creates a dynamic sql string based on data provided by an input.
    e.g.
    "SqlSelectStatement = "Select * from tableName where FieldToFilter in (" + InputPinValue + ")"
    sqlSelect(1,SqlSelectStatement)

    This works perfectly fine when there is a value in the InputPinValue but obviously errors when there is no value in the input. The output pin of this DB execute node is connected to a Cat node where I combine the data found in this DB execute with other DB Execute node values.

    Please can you help me understand how I can bypass this single node if there is no value in the input pin? I've tried the switch node, the bypass node and the meta check node with no success, I still need the Cat node to run, I just need to pass it an empty value if this DB Execute node is unable to run either by passing it the vaue of an alternative node, or by amending the brainscript to not run the sqlSelect statement above but instead return a blank/null value.

    Many thanks


  • 2.  RE: Bypass a node

    Employee
    Posted 10-02-2015 10:33

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

    Originally posted by: stonysmith

    Doing this the way you ask, with metacheck, is rather tricky.
    It's quite a bit easier to modify the SQL a bit.

    values=joinStrings(InputPinValue, "0000impossiblevalue000", ",")

    Select * from tableName where rownum=1 or FieldToFilter in (" + values + ")"

    This way, even if there is no values in the input, the query will still be able to look for the "impossible" value and will return a result (with column headers, etc.)


  • 3.  RE: Bypass a node

    Employee
    Posted 10-02-2015 10:46

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

    Originally posted by: karennap

    ooh nice - thank you so much!