Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: Substituting Variables in a SQL Statement stored in a table by values in other table

  1. #1
    Join Date
    Dec 2015
    Posts
    6

    Post Substituting Variables in a SQL Statement stored in a table by values in other table

    Hi ,

    I am having a SQL query stored in a table and want to substitute some of the variables in that SQL query with column values in another table.
    I am unable to achieve this. Can some one help on this?

    Thanks in advance !!

    Regards
    Kritika

  2. #2
    Join Date
    Nov 2014
    Posts
    150

    Default

    Hi, Kritika.

    It should be similar to what I told you in this other thread: http://forums.pentaho.com/showthread...SQL-statements

    The only difference is that instead of using the 'Replace with' option, you should use 'Replace with field', and select the field that contains the value for the variable. Remember that in the database input step you should query both the instruction column and the parameter column, so that you can select them in the 'Replace in String' step.
    Best Regards,

    Hugo Cerqueira
    Business Intelligence / Data Warehouse Analyst

  3. #3
    Join Date
    Dec 2015
    Posts
    6

    Default

    Thanks Hugo !!
    This has helped me in solving my issue. I was doing the same what you have mentioned , only mistake was , in the database input step to 'Replace with' I was not including the instruction column. :-)
    Those columns were included in prior steps but not in the step just before 'Replace with'.

    Regards
    Kritika

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.