Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: How to insert a dynamic count from one DB into another one?

  1. #1

    Default How to insert a dynamic count from one DB into another one?

    Hi!

    Here's the situation :
    • one database A with several tables (TA1,TA2,TA3,....)
    • one database B with one table like this [TA_names, TA_count]


    I want to populate B table like this :
    • TA1 - 20 (rows)
    • TA2 - 156
    • TA3 - 7
    • ....


    B table already have TA_names, so how can I update TA_count with something like "select count(*) as from ?"

    Thanck's
    pdi-ce-4.4.0-stable
    jdk1.7.0_09
    Intel Core I3-2330M@2.2Ghz - 8Go ram
    Windows 7 FEP SP1

  2. #2
    Join Date
    Sep 2007
    Posts
    834

    Default

    if you have the table name in a variable, you could run the following query in a table input:
    select "${table_name}" as ta_name, count(*) as ta_count from ${table_name}

    and then use an Update step for updating the TA_count column in the B table.

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.