Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: variable table and column names

  1. #1
    Join Date
    Nov 2007
    Posts
    1

    Cool variable table and column names

    Howdy,

    Can someone point me to a resource or tell me how I could use an input parameter as a table and/or column name in the SQL?

    Example of what I'd like:
    <inputs>
    <table type="string">
    <default-value></default-value>
    <sources>
    <request>table</request>
    </sources>
    </table>
    <column type="string">
    <default-value></default-value>
    <sources>
    <request>column</request>
    </sources>
    </column>
    </inputs>

    ...

    <component-definition>
    ...
    <query><![CDATA[select {column} FROM {table}]]></query>
    <live><![CDATA[true]]></live>
    </component-definition>
    Last edited by bbbiEmpNum2; 01-17-2008 at 02:15 AM.

  2. #2
    gmoran Guest

    Default

    Your syntax is very close, you just need to make sure you define column and table as inputs to your query action, aand also prepend your variables in the SQL with PREPARE: .

    For examples of such parameterization you can look in the reporting samples, or the Steel Wheels samples .

  3. #3
    gmoran Guest

    Default

    Also, read up here for explanation of PREPARE:

    http://wiki.pentaho.org/display/COM/...able+Solutions

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.