Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Simple SQLExecute from Secure Filter

  1. #1

    Default Simple SQLExecute from Secure Filter

    Hi

    I am new to pentaho and have been struggling to create a simple form that inserts a username into the database. I have attached my xaction. Basically the form works well and when I submit it simply returns to the form and does no database insert. I only see a warn message [Parameters] Parameters: Invalid chunk ignored.


    Any help would be apprecaited
    Attached Files Attached Files

  2. #2

    Default SQLExecute with parameters

    I decided to simply try and do SQLExecute with hardcoded values and this insert works (same insert from above) so it seems to be either a problem with using my parameters from the Secure Filter or with how I am using paramaters. I use them like insert into .... values('{username}' and so forth

  3. #3
    Join Date
    Jul 2007
    Posts
    2,498

    Default

    I've done that several times and it worked, my xactions are very similar to yours
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  4. #4

    Default IF statement

    Hi

    I solved this problem and now have moved on with a new problem:-

    Once I run the insert I want to display a friendly message for a successful insert or for a failure.

    I use the <condition> but it seems as if the SQLExecute failure means it does not move on to the next action?

    i.e. in the browser I see the error message from the failed execute
    Error: SQLBaseComponent.ERROR_0006 - Could not execute adduser.xaction : Duplicate entry 'jason' for key 1 (org.pentaho.plugin.sql.SQLExecute)

    When I set continue_on_exception to true it moves on but then I am not sure what condition test to perform as using the following:-


    <actions>
    <condition><![CDATA[query_result.getRowCount() >0]]></condition>
    <action-definition>
    <component-name>TemplateComponent</component-name>
    <action-type>Message Template</action-type>
    <action-inputs>
    <username type="string"/>

    </action-inputs>
    <action-outputs>
    <output-message type="string" mapping="statusmsg"/>
    </action-outputs>
    <component-definition>
    <template><![CDATA[{username} was created successfully]]></template>
    </component-definition>
    </action-definition>

    </actions>

    <actions>
    <condition><![CDATA[query_result.getRowCount() == 0]]></condition>
    <action-definition>
    <component-name>TemplateComponent</component-name>
    <action-type>Message Template</action-type>
    <action-inputs>
    <username type="string"/>
    </action-inputs>
    <action-outputs>
    <output-message type="string" mapping="statusmsg"/>
    </action-outputs>
    <component-definition>
    <template><![CDATA[Failed to create {username}.]]></template>
    </component-definition>
    </action-definition>

    </actions>

    it always says successful regardless. I tried using
    <condition><![CDATA[query_result]]></condition>
    and
    <condition><![CDATA[!query_result]]></condition>

    with same result

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.