Hitachi Vantara Pentaho Community Forums
Results 1 to 6 of 6

Thread: Evaluation of query result

  1. #1
    Join Date
    Sep 2005
    Posts
    1,403

    Default Evaluation of query result

    Attachment: Sans titre.JPG Hi,
    How can i evaluate the result of a query like this


    select count(*) nb from personne



    1- I create a job with the following steps :
    --> Start
    --> SQL ( select count(*) nb from personne)
    --> Evaluation



    How can i get in the Evaluation step the result of that query ?
    Depending of this result, i send a mail (for exemple).



    Thanks



    samatar

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

    Default RE: Evaluation of query result

    Send the result of the count(*) to step "Copy Rows To Result".



    In the evaluation you can reach the rows like this:



    <pre>
    var nr = rows[0].getInteger("nr", -1);

    nr > 500
    </pre>


    I tried it, it actually works ;-) Never had the need for it though...


    HTH,



    Matt

  3. #3

    Default RE: Evaluation of query result

    Ah...

    To be sure that i understand..

    1- i have to create a Transformation with 2 steps :
    - "Table input" with select count(*) from ...
    - "Copy rows To result"

    2 - Use in the job "Evaluation" With your piece of code.
    Samatar

  4. #4
    Join Date
    Sep 2005
    Posts
    1,403

    Default RE: Evaluation of query result

    Attachment: Sans titre.JPG It do not work !!!

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

    Default RE: Evaluation of query result

    Attachment: yesitworks.PNG You mean the select count(*) doesn&#39;t work?
    I can hardly believe that.
    Anyway, the full job I tested with is shown in attachement.

    Cheers,
    Matt

  6. #6
    Join Date
    Sep 2005
    Posts
    1,403

    Default RE: Evaluation of query result

    Sorry..It works perfectly.. :-)
    Thanks for all your efforts

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.