Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: connection using dynamic data

  1. #1
    Join Date
    May 2008
    Posts
    1

    Default connection using dynamic data

    Hi there,

    I have a series of databases, one per client, and a lookup table that describes which server the databases are on. I can't for the life of me work out how to do this (all mysql):

    select server from lookup_table where clientid=1

    connect to "server" and database track_$clientid

    select * from sales_$clientid in that database.

    I didn't design this DB schema, I hasten to add

    Any help or pointers gratefully appreciated.

    Thanks,

    Adam.

  2. #2
    Join Date
    Nov 1999
    Posts
    9,729

    Default

    Well, you typically send the N rows with connection data to step "Copy rows to result".
    Then in the next job entry (in a job) you have a sub-Job called S. "execute once for each result row" make sure you execute the job N times.
    In the first job entry of S, you have a transformation that defines the variables like ${hostname}, etc.
    If you have a step "Get rows from result" in there, you'll get one row for each of the N executions.
    In the next job entries in S you can re-use those environment variables all over the place, including in database connections.

    Matt

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.