Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: FK Insert Issue.

  1. #1
    Join Date
    Sep 2012

    Default FK Insert Issue.


    This is the 2nd day with this tool, so please dont be too harsh.

    I have a Postgres DB table, which i can happily insert data & get the sequence PK from using the
    Table Output "return auto generated key" function. I can log the retrieved PK successfully.

    I have a second table, which references the newly created PK. This table is filled by a 2nd Table Output
    function, but errors as it breaks the FK constraint. Do you have to commit some parts of the transform ?

    Error below:

    2012/09/07 14:31:37 - Table output 2.0 - WARNING: Couldn't insert row into table: [2824], [Project]
    2012/09/07 14:31:37 - Table output 2.0 -
    2012/09/07 14:31:37 - Table output 2.0 - Error inserting/updating row
    2012/09/07 14:31:37 - Table output 2.0 - ERROR: insert or update on table "MySecondTable" violates foreign key constraint "FK_MySecondTable_MyFirstTable"
    Detail: Key (MySecondTableID)=(2824) is not present in table "MyFirstTable".

    I know the ID (2284) is present in MyFirstTable, but the tool is telling me otherwise.

    What i need is a basic example showing me how its done. As much as this tool is very powerfull, i get the impression from
    other posts its very quirky and problems seemed to be solved by adding extra steps in which dont seem to be required.

    Any help or links to others with this newbie problem is most welcome.


  2. #2
    Join Date
    Nov 1999


    Every step runs in a different transaction on a different db connection. You can change this by making the transformation database transactional (Transformation settings dialog, Misc tab).

  3. #3
    Join Date
    Sep 2012


    Thanks for the info.

    The trans is now transactional and i am getting the desired results


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.