Data360 Analyze

 View Only
  • 1.  Conditional "DbUrl" & "SqlQuery" values for JDBC Query node

    Posted 03-04-2020 12:58

    In one of our "JDBC Query" nodes, we have a need to modify our "DbUrl" connection property based on what environment the workflow is in. I can connect an input into the "JDBC Query" node that has a single one-row column (ie. a single data point) that can calculate the appropriate DbUrl. based on the environment, but I can't figure out a way to pass the value onto the "JDBC Query" node.

    Similarly, I need to pass on a "SqlQuery" value because some of the table names are different across the different environments. What's the best way to accomplish both these things? 

    I've attached a simple example of what I'm currently trying. (For simplicity I subbed out my actual logic with a Create Data node just to see if I could get a simpler example to work since the concept of passing the value is my main concern).

     

    Attached files

    DbUrl_Test.PNG

     



  • 2.  RE: Conditional "DbUrl" & "SqlQuery" values for JDBC Query node

    Employee
    Posted 03-07-2020 02:16

    The JDBC Query and JDBC Execute nodes have been enhanced to support dynamic SQL provided
    from an input field. There is now a from Field option on the SqlQuery property on both the JDBC
    Query and JDBC Execute nodes, to enable you to take the SQL from an input field.

    The DbUrl property value cannot be sourced from an input field. You could use Run property substitutions to specify the elements of the connection URL that need to change depending on the environment the data flow is being run in. See the 'Advanced topics' > 'Using derived property values' topic in the integrated Help. The information is also available online for the latest version of the software here.

    Note also that Run Property Sets were also introduced in 3.6.0 LTS. See the 'Advanced topics' > Defining properties' > 'Run property sets' topic in the Help, or online here