Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: setting a table input with an sql querry comming from a text file

  1. #1
    Join Date
    Jun 2013
    Posts
    4

    Post setting a table input with an sql querry comming from a text file

    Hi all,
    I'm currently working on PDI and I want to know if it's possible to set a table input with an sql querry coming from a file ( csv for example).
    In fact I have several identical databases and I want to get the same information from all the databases.
    Currently , I use the component table input where I set manually my querry ( copy and paste in all the inputs), but I want to write the querry only once and after reuse it in all my table inputs without paste it or rewrite it.
    So if you have any idea of what to do, I'm all ears.
    Thank you for your availability

  2. #2
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    Quote Originally Posted by nad View Post
    I want to know if it's possible to set a table input with an sql querry coming from a file ( csv for example).
    The SQL field of the Table Input settings dialog features PDI variable expansion, so you shouldn't have a hard time to tweak a SELECT statement or even provide a complete one in a variable set from a CSV field.
    Just remember, that you can't set and use a variable in the same step, so you need two transformations in a job.
    So long, and thanks for all the fish.

  3. #3
    Join Date
    Apr 2008
    Posts
    4,696

    Default

    For that matter, you should be able to use variables and use ONE select statement since the DBs are all the same... Use the variables to loop through the DBs changing the connection information across runs.

    As marabu suggests, you'll still need to have a job and a couple of transformations.
    **THIS IS A SIGNATURE - IT GETS POSTED ON (ALMOST) EVERY POST**
    I'm no expert.
    Take my comments at your own risk.

    PDI user since PDI 3.1
    PDI on Windows 7 & Linux

    Please keep in mind (and this may not apply to this thread):
    No forum member is going to do your work for you. We will help you sort out how to do a specific part of the work, as best we can, in the timelines that our work will allow us.
    Signature Updated: 2014-06-30

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.