Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Passing values to table input

  1. #1
    Join Date
    Oct 2006
    Posts
    14

    Question Passing values to table input

    I am trying to get values from a table input step passed to another table input step. This works except when I try to use it to be part of the table name. For example I have a series of tables that have dates as a part of their tablename. (costs_200701). So I am passing 200701, as an integer, through to the next step and including it in the query like costs_?. I have done this before but for some reason it isn't working now. The only difference is that I am running spoon on windows instead of linux though it is the same version # (2.5.0).

    I will attach the transformation I am using.

    The error I am getting is:

    2007/09/07 22:14:43 - Get Costs.0 - ERROR (version 2.5.0, build 25002 from 2007/05/04 00:20:04) : Unexpected error in 'be.ibridge.kettle.core.exception.KettleDatabaseException:
    2007/09/07 22:14:43 - Get Costs.0 - ERROR (version 2.5.0, build 25002 from 2007/05/04 00:20:04) : An error occurred executing SQL:
    2007/09/07 22:14:43 - Get Costs.0 - ERROR (version 2.5.0, build 25002 from 2007/05/04 00:20:04) : SELECT
    2007/09/07 22:14:43 - Get Costs.0 - ERROR (version 2.5.0, build 25002 from 2007/05/04 00:20:04) : product_id
    2007/09/07 22:14:43 - Get Costs.0 - ERROR (version 2.5.0, build 25002 from 2007/05/04 00:20:04) : , cost
    2007/09/07 22:14:43 - Get Costs.0 - ERROR (version 2.5.0, build 25002 from 2007/05/04 00:20:04) : FROM costs_?
    2007/09/07 22:14:43 - Get Costs.0 - ERROR (version 2.5.0, build 25002 from 2007/05/04 00:20:04) :
    2007/09/07 22:14:43 - Get Costs.0 - ERROR (version 2.5.0, build 25002 from 2007/05/04 00:20:04) : ERROR: relation "costs_$1" does not exist
    2007/09/07 22:14:43 - Get Costs.0 - ERROR (version 2.5.0, build 25002 from 2007/05/04 00:20:04) : be.ibridge.kettle.core.exception.KettleDatabaseException:
    2007/09/07 22:14:43 - Get Costs.0 - ERROR (version 2.5.0, build 25002 from 2007/05/04 00:20:04) : An error occurred executing SQL:
    2007/09/07 22:14:43 - Get Costs.0 - ERROR (version 2.5.0, build 25002 from 2007/05/04 00:20:04) : SELECT
    2007/09/07 22:14:43 - Get Costs.0 - ERROR (version 2.5.0, build 25002 from 2007/05/04 00:20:04) : product_id
    2007/09/07 22:14:43 - Get Costs.0 - ERROR (version 2.5.0, build 25002 from 2007/05/04 00:20:04) : , cost
    2007/09/07 22:14:43 - Get Costs.0 - ERROR (version 2.5.0, build 25002 from 2007/05/04 00:20:04) : FROM costs_?
    2007/09/07 22:14:43 - Get Costs.0 - ERROR (version 2.5.0, build 25002 from 2007/05/04 00:20:04) :
    2007/09/07 22:14:43 - Get Costs.0 - ERROR (version 2.5.0, build 25002 from 2007/05/04 00:20:04) : ERROR: relation "costs_$1" does not exist
    2007/09/07 22:14:43 - Get Costs.0 - ERROR (version 2.5.0, build 25002 from 2007/05/04 00:20:04) :
    Attached Files Attached Files
    Last edited by dicer; 09-08-2007 at 12:25 AM.

  2. #2
    Join Date
    May 2006
    Posts
    4,882

    Default

    Show me the proof you've done that before

    It isn't working on any version. Parameters cannot be part of a table, variables can.
    What happens:
    - Table input -when variable replacement is on- replace the kettle variables by it's real values (just a replacement).
    - Then the complete statement is passed to JDBC together with the arguments, and the arguments get bound on the SQL statement using JDBC calls.

    Now the reason that you can't use parameters as part of a table is that they're used by the database to determine which columns are valid in the select, acccess rights, ...

    I added a question/answer to the PDI FAQ.

    Regards,
    Sven
    Last edited by sboden; 09-08-2007 at 05:52 AM.

  3. #3
    Join Date
    Oct 2006
    Posts
    14

    Default

    Our bandwidth tables for users are seperated out by day. I have several transformations that run every day to update a summary. Here is one of them.

    For whatever reason it works for me on those just fine. I guess though if I can't do it this way I will need to have two separate transformations, one that sets the tablename and the other one that reads it.
    Attached Files Attached Files

  4. #4
    Join Date
    May 2006
    Posts
    4,882

    Default

    I guess though if I can't do it this way I will need to have two separate transformations, one that sets the tablename and the other one that reads it.
    Yep ......

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.