Hitachi Vantara Pentaho Community Forums
Results 1 to 1 of 1

Thread: Dynamic Parameters and Query

  1. #1

    Default Dynamic Parameters and Query

    Hello guys,

    I am trying to insert a data to destinationDB from a dynamic datasource as well as its query in getting the data. That said the columns and table to insert may vary. But, the thing is that the columns and tables are saved as rows in a table at the destinationDB. That means though it is dynamic, I already have an idea to where to insert it and what are its columns. So, yeah that's the back story of my problem.

    Anyway, the problem is on the insert side. I was able to generate SELECT statement to get the datasource and did get the data, by manipulating the data to get the query.

    This is what it looks like now. Do mind the get variables, that is how I generate the sql queries.

    Name:  dynamic insert select.jpg
Views: 261
Size:  7.9 KB

    Inside the Table input looks like this:
    Name:  table input.jpg
Views: 266
Size:  12.4 KB

    Here is the Execute SQL Statement:
    Name:  insert with params.jpg
Views: 273
Size:  22.9 KB

    See the dynamic part? anyway, the thing is that the ${INSERT_VALUES} in the insert script variables are all '?' character which the data is suppose to be provided by the table input. For me to identify how many columns.

    Problem 1: As you can notice in the 'Execute SQL Statement' step I did not pass any parameter to provide the '?' on the insert. That is because I do not know what to tag there because the parameter/columns vary everytime. Depends on what table to insert. Is there a way to approach this?
    Problem 2: Does pentaho allow a sort of like double substituion? substitute the variable to its value and substitute the '?' to the parameter value?

    Thank you.
    Attached Images Attached Images  

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.