Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: Sql-File as Table Input

  1. #1
    Join Date
    Jan 2017

    Default Sql-File as Table Input


    I have a bunch of SQL Files with Select Statments and would like them to work as Input for the Table Input.

    Right now I read the Sql-File with "get file names" that sends it to the result set

    in the next transformation I use the "Get Files from result" and set a hop to the "Set Variables" Step to create a variable with the path of the file.
    but if i put that variable into the Table Input it does not work

    is there someone that can help me fix my problem ?
    i feel like its not that hard but i cant get my head around

    kind regards

  2. #2
    Join Date
    Jun 2012


    "it does not work" is the thing to say to your mechanic to ensure huge bills.
    You can get away with it here, because we won't charge you.

    Just in case you really tried to use a filename instead of the file content as your SQL statement:

    • Use Text-File-Input and a regular expression like .+\.sql to read all SQL files (FIXED format, single conveniently sized trimmed field).
    • Each field now contains a SELECT statement you can send to the next transformation using Copy-Rows-To-Result.
    • That next transformation should be excuted for each input row, with a parameter SQL initialized to the field value (advanced options).
    • Table-Input now can refer to the parameter as ${SQL}.
    So long, and thanks for all the fish.

  3. #3
    Join Date
    Jan 2017


    hey marabu!
    shame on me...

    i tried it once with the text file input and failed at it so i tried it with the get file names...

    but everything works now thanks to you!
    + thanks for not charging me

    kind regards hulk

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.