Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Execute SQL Script step

  1. #1
    Join Date
    May 2011

    Default Execute SQL Script step


    I am running a SQL script using the execute sql script step.

    I am declaring and assigning a variable @X in the script based on an if condition. When my script runs for the second row, @X is null since the if condition is not supposed to succeed for the second time. But I need the value of variable created during the first row to be inserted into a table for all the remaining rows as well. Could anyone please suggest as to how the value of @X that had been assigned in the first row be used for the subsequent rows as well.

    Thanks in advance.

  2. #2



    Try adding a "modified javascript value" after your table input, just add the conditional code to set a new field, then select it in the "Fields" table. eg.
    if (somefield=="somevalue")
      var X = "anothervalue";
    and enter (Fieldname:X, Type:String) in the fields table. I think that'll do what you're after

    Mark, Cloud2Land

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.