Hitachi Vantara Pentaho Community Forums
Results 1 to 7 of 7

Thread: Writing back to DB

  1. #1
    Join Date
    Oct 2014
    Posts
    7

    Default Writing back to DB

    Would it be possible to write data back to a database table? For example, we want to use this to display a list of possible fraud. We would like to give the user the capability to finalize a record by updating a status field (basically updating to confirm it was or was not fraud). These status updates would then be used to retrain the analytics engine with the updates results. Can this be done using CTools?

  2. #2
    Join Date
    Nov 2011
    Posts
    1,229

    Default

    Yeah, use a CDA Kettle datasource and have your ktr do the update / insert. Then you can have that cda called from a button component or a query component or whatever
    Pedro Vale
    --
    CTools Product Development
    http://www.webdetails.pt

  3. #3
    Join Date
    Oct 2015
    Posts
    7

    Default

    Hi pamval, your answer join my problematic !

    is it possible to use same way to update multiple fields in one call to CDA Kettle datasource ?

    thanks
    Oliver

  4. #4

    Default

    Sure you can : inestigate a bit in PDI and you will find suited transformations to do it : Dynamic SQL Script taking an Update from a variable could fit your needs

  5. #5
    Join Date
    Jan 2014
    Posts
    189

    Default

    I don't see any reason why you shouldn't be able to use Ctools for this. It seems fairly standard logic to me.

  6. #6
    Join Date
    Oct 2015
    Posts
    7

    Default

    Thanks guys !

    And starting from the start : I want a Ctools table with some editable fields the user can modify and push back to DB

    Have you ever implemented such a solution or could you advice me on how to ?

    Thanks

  7. #7
    Join Date
    Jan 2014
    Posts
    189

    Default

    This is not an entirely trivial thing to do, but this is something that has been done before.

    One approach would be:

    Write addIns for the TableComponent, which you will use in the cells that need editing.
    The addIns need to update the resultset feeding the table (i.e. must update st.tableData) when the user stops editing the input box.
    To update the database table, you must write a query that updates the relevant records, and that takes the table resultset as a parameter.

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.