Hitachi Vantara Pentaho Community Forums
Results 1 to 6 of 6

Thread: Question: How do I run this SQL?

  1. #1

    Default Question: How do I run this SQL?

    How do I make the result of Aggregate Rows run in Execute SQL script?

    This process is an image attachment.
    Attached Images Attached Images  

  2. #2
    Join Date
    Feb 2009
    Posts
    321

    Default

    you must check "variable sustitution"...
    example if you want consult about a string you put this

    update table set field_1= 'MY_CHANGE' where conditon_field = ?

    in this script the sign ? is the parameter

  3. #3

    Default

    Hello,

    I tried but did not run.
    You could send a sample, please.

    Thanks.

  4. #4
    Join Date
    Feb 2009
    Posts
    321

    Default

    hi.. here I'm attaching one transformation...take a look and tell me later...
    good luck
    Hernan
    Attached Files Attached Files

  5. #5

    Default

    Hello!

    This a good example!

    Now, I have another problem:

    In the example of my attachment, the step_Generate_Rows simulates a table.
    And step_Filter_rows simulates a condition.
    If there is no true condition, the step_Aggregate_Rows show a problem!

    To simulate the problem, you can record 5 in the limit_ step_Generate_Rows.

    Thanks!

  6. #6
    Join Date
    Feb 2009
    Posts
    321

    Default

    Quote Originally Posted by alexandredneto View Post
    Hello!

    This a good example!

    Now, I have another problem:

    In the example of my attachment, the step_Generate_Rows simulates a table.
    And step_Filter_rows simulates a condition.
    If there is no true condition, the step_Aggregate_Rows show a problem!

    To simulate the problem, you can record 5 in the limit_ step_Generate_Rows.

    Thanks!

    mmm I don't see your point, ... but, you don't use the script in this way: "insert into table values all_previous_rows". if you need this, I suggest a change in your transformation, you should be replaced the step agreggate rows for the step add constants. In this step you create the fields necessary for the script.

    example for the step "ADD CONSTANTS": (the datatype is invented for me)
    field_1 = 1000 (number)
    field_2 = 'VALUE NEGATIVE' (string)
    field_3 = 20/12/2010 (date)

    so .. in the next step (the sql script) your script its like

    insert into table field_1, field_2,field_3 values (?,?,?)

    and work with the parameters like the previous post, don't forget add all parameters in the section "Parameters" of the step "sql Script"

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.