Hitachi Vantara Pentaho Community Forums
Results 1 to 7 of 7

Thread: execute sql script with args

  1. #1
    Join Date
    Jul 2007
    Posts
    10

    Default execute sql script with args

    I can read my input args and write it into a file,but can't use it to execute a sql script,please help,thanks!

    This is the Transformation:sql.ktr

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

    Default

    Switch on "execute for each row". If you don't switch it on the SQL step will execute the sql at initialization time, this one is the odd duck in the collection

    Regards,
    Sven

  3. #3
    Join Date
    Jul 2007
    Posts
    10

    Default

    Thanks so much,it works fine now!

  4. #4
    Join Date
    May 2007
    Posts
    13

    Default adding variable substitution to exec sql

    I realize that you can use the 'execute for each row' mechanism to inject runtime values into the sql but it would seem to me that the exec sql transform should support variable substitution using the normal ${ ... } syntax. Unless someone thinks this would be a bad idea i would like to add support for variable replacement to the execsql transform.

  5. #5

    Default

    I needed this feature at work.
    I posted a CRQ :

    http://www.javaforge.com/proj/tracke...e&task_id=5779

    Should be a nice idea for me :-)

    Samatar

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

    Default

    Wrong forum Jay.... but if you replace

    Code:
    StringBuffer sql = new StringBuffer(meta.getSql());
    in ExecSQL by

    Code:
    StringBuffer sql = new StringBuffer(environmentSubstitute(meta.getSql()));
    that would be it qua execution component.

    But this would allow only one-time variable replacement, the variables are set at the start of the transformation and aren't changed afterwards. And even if they could be, variables should not be changed between successive rows (in a single execution of a transformation).

    Regards,
    Sven

  7. #7

    Default

    It's the behaviour that i expect for variable support.

    Rgds

    Samatar

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.