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.  Reusing rsult of JDBC Query node inside anoh node

    Employee
    Posted 06-23-2009 13:02

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

    Originally posted by: orfano

    Lads,

    I am new starter with Brain.

    In a JDBC Query node I am extracting some data using SQL script (select field1 from A where field2 > 090123 and field2 <090223).

    From the result of this query I would like to use field1 inside another JDBC Query (other tables) so I will load only the relevant data. Basically from the first JDBC query node I would like to insert the result in others JDBC query nodes inside a SQL IN operator.

    How could I achieve that?

    Thank you in advance,


    Flavio


  • 2.  RE: Reusing rsult of JDBC Query node inside anoh node

    Employee
    Posted 06-23-2009 14:08

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

    Originally posted by: ltolleson

    You can do this 2 different ways.

    1) Just add the second table to the first query as a join or nested select inside the SQL for the first JDBC Query.

    If you need to alter the data before querying from the second table then use option 2 below.

    2) Take the output from the first node and put it into a JDBC Execute node. This node by default has no inputs, so you will need to create an input for the node. You can do this by simply dropping the output from the first query onto the node. Once you have an input into the JDBC Execute node and have the data connected you will need to write the syntax in the SqlQuery parameter to use the field1 data in the query of the next table.

    Example
    ---------------------

    # The command below could be used in the SqlQuery # field in the JDBC Execute node.

    sqlSelect(1,
    "select * from table where field = :1",
    ���field1���)


    Hope this helps...