Hitachi Vantara Pentaho Community Forums
Results 1 to 8 of 8

Thread: Executing SQL Scripts sequentially

  1. #1
    Join Date
    Sep 2008
    Posts
    3

    Question Executing SQL Scripts sequentially

    Hi There,
    I am trying to execute some SQL scripts sequentially (one after the other), but it seems that each SQL script is being run in a separate thread in parallel.
    since each script depends on the previous script the results are definitely,not as expected.

    how can I execute the SQL scripts sequentially?

    thanks,
    Natan


  2. #2

    Default

    Typically all steps in a jobs do run sequentially. And ALL steps in a transformations run in parallel.
    So do your SQL scripts are part of a job or a transformation?

    BTW: A SQL script can consist of multiple commands. These commands are definitely execute one by one.

    Christoph
    21 is only half the truth

  3. #3
    Join Date
    Sep 2008
    Posts
    3

    Smile

    thanks for the reply. I didn't know this difference between Jobs and transformation.

    still, I found another way to do it - put a "Blocking Step" between the steps of the transformation.

    cheers,
    Natan

  4. #4
    Join Date
    Mar 2009
    Posts
    8

    Default

    Hi,
    I have quite similar problem.
    At the end of my transformation I want to run my SQL script (which don't has any input parameter). But it always executes at the beginning of my transformation.
    I tried already with putting blocking step between the sql script and the step before it. But that seems not work like I expect.

    Then I tried for testing to add the same SQL script to the job right after my transformation. Then it is working fine. So my SQL script itself is correct.
    But I need the SQL script step inside the transformation.

    So how have you managed with the blocking step or something else to start the SQL script in the order after the step before?

    Thanks,
    Sandy

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

    Default

    Sandy, are you serious? Did you ever consider creating a job to that? Why not try that?

  6. #6
    Join Date
    Mar 2009
    Posts
    8

    Default

    Yes, I created a job for that as work around. And it works fine.

    I'm still in getting to know PDI phase...
    I was thinking, maybe I do something wrong if my Blocking Step is not working correctly.
    In the documentation is written:
    Use the Blocking Step for triggering ... stored procedures ... or for synchronization purposes.
    So
    I assumed that the start of steps after a Blocking Step will be delayed until the last row in the transformation has reached this point. Am I wrong with my assumption?

    Regards,
    Sandy


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

    Default

    All steps are started in parallel... the ones after the blocking steps will get their data later. But they do start all at the same time.

    Exec SQL step is 'problematic' in the sense that if it doesn't "execute for each row", it executes 1 time at the start of the transformation (regardless of where it is in the graph ). It's a legacy thing, this is the only step that does it this way... So follow Matt's advice and use jobs

    Regards,
    Sven
    Last edited by sboden; 03-06-2009 at 05:35 AM.

  8. #8
    Join Date
    Mar 2009
    Posts
    8

    Default

    Thank you for this explanation. It helps a lot in understanding.

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.