Data360 Analyze

 View Only
  • 1.  JDBC execute - use input in SQL querry

    Employee
    Posted 01-08-2020 07:17

    Hi,

    I am trying to use input data in my SQL code, but something seems wrong. 
    The goal is to remove the records form an SQL table that have a Run_date that i specify in D3S.

    Code in the JDBC execute node is as follows:
    The column Run_date in my SQL table is of type date.

    The input data looks as follows:
     Alternatively I tried inputting a string.
    Both cases the error message was:

    How do I use input data as a criteria in my SQL code?



  • 2.  RE: JDBC execute - use input in SQL querry

    Employee
    Posted 01-08-2020 18:35

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

    You don't need to use the 'Use DbName' in the node. You should have that specified in your connection details. Then to reference your fields on the input pin you specify them in the SqlQueryFieldBindings and reference them (in order) with a ?.

    In screenshot example attached, I have a table called people with first and last names in it, I want to delete the rows that match the field LastName on my input.

     

    The help documentation explains it well also.

     

     

    Attached files

    delete_sql.png

     



  • 3.  RE: JDBC execute - use input in SQL querry

    Employee
    Posted 01-09-2020 04:12

    The ? worked!
    Indeed the DBname in the code was redundant and specified in the connection details.

    Thank you for the help!