Customer Portal

Order of table columns and null values

Comments 9

  • Avatar
    axetheaxe
    0
    Comment actions Permalink
    I forgot to attach the error message:


    WARN [test_table_OUTPUT] - Cannot insert the value NULL into column 'active', table 'clover_test.dbo.test_table'; column does not allow nulls. INSERT fails.
    ERROR [test_table_OUTPUT] - java.sql.SQLException: Maximum # of errors exceeded when inserting record: Cannot insert the value NULL into column 'active', table 'clover_test.dbo.test_table'; column does not allow nulls. INSERT fails.
    FATAL [WatchDog] - !!! Fatal Error !!! - graph execution is aborting
    ERROR [WatchDog] - Node test_table_OUTPUT finished with status: ERROR caused by: Maximum # of errors exceeded when inserting record: Cannot insert the value NULL into column 'active', table 'clover_test.dbo.test_table'; column does not allow nulls. INSERT fails. caused by: java.sql.SQLException: Maximum # of errors exceeded when inserting record: Cannot insert the value NULL into column 'active', table 'clover_test.dbo.test_table'; column does not allow nulls. INSERT fails.
    DEBUG [WatchDog] - Node test_table_OUTPUT error details:
    org.jetel.exception.JetelException: Maximum # of errors exceeded when inserting record: Cannot insert the value NULL into column 'active', table 'clover_test.dbo.test_table'; column does not allow nulls. INSERT fails. caused by: java.sql.SQLException: Maximum # of errors exceeded when inserting record: Cannot insert the value NULL into column 'active', table 'clover_test.dbo.test_table'; column does not allow nulls. INSERT fails.
    at org.jetel.component.DBOutputTable.execute(DBOutputTable.java:522)
    at org.jetel.graph.Node.run(Node.java:366)
    at java.lang.Thread.run(Thread.java:619)
    Caused by: java.sql.SQLException: Maximum # of errors exceeded when inserting record: Cannot insert the value NULL into column 'active', table 'clover_test.dbo.test_table'; column does not allow nulls. INSERT fails.
    at org.jetel.component.DBOutputTable.runInNormalMode(DBOutputTable.java:566)
    at org.jetel.component.DBOutputTable.execute(DBOutputTable.java:518)
    ... 2 more
  • Avatar
    avackova
    0
    Comment actions Permalink
    Hi,
    you can use dynamic metadata instead of autogenerated:
    <Metadata id="DBMetadata" connection="ConnectionIn" sqlQuery="select * from test_table where 1=0"/>.
    See also graphDBUnloadUniversal.grf example.
  • Avatar
    axetheaxe
    0
    Comment actions Permalink
    This does not solve the problem (indeed, i tried it)! I think the metadata is configured properly. Other tables without null values are transferred correct. If I connect a 'DataWriter' to the error port of 'DBOutputTable' I can see that the boolean values for attribute 'active' are missing although in the database there are values.

    Thanks
    Alex
  • Avatar
    axetheaxe
    0
    Comment actions Permalink
    I tried it on the same database in postgres with a second identical table 'test_table2' with the same result:


    DEBUG [WatchDog] - Node test_table_OUTPUT error details:
    org.jetel.exception.JetelException: Maximum # of errors exceeded when inserting record: ERROR: null value in column "act
    ive" violates not-null constraint caused by: java.sql.SQLException: Maximum # of errors exceeded when inserting record:
    ERROR: null value in column "active" violates not-null constraint
    at org.jetel.component.DBOutputTable.execute(DBOutputTable.java:522)
    at org.jetel.graph.Node.run(Node.java:366)
    at java.lang.Thread.run(Thread.java:619)
    Caused by: java.sql.SQLException: Maximum # of errors exceeded when inserting record: ERROR: null value in column "activ
    e" violates not-null constraint
    at org.jetel.component.DBOutputTable.runInNormalMode(DBOutputTable.java:566)
    at org.jetel.component.DBOutputTable.execute(DBOutputTable.java:518)
    ... 2 more
  • Avatar
    axetheaxe
    0
    Comment actions Permalink
    Okay, it seems that nobody has an idea about this. So I will post an issue.

    Thanks
    Alex
  • Avatar
    avackova
    0
    Comment actions Permalink
    New version (2.4) of CloverETL will have BooleanDataField. It could resolve your problem.
  • Avatar
    axetheaxe
    0
    Comment actions Permalink
    Ok. When do you plan to release? How stable is the snapshot version?

    Thanks again for your quick reply
    Alex

    p.s.: I will nevertheless post an issue
  • Avatar
    avackova
    0
    Comment actions Permalink
    Hi,
    I've found a bug when copying boolean from database. Till next release I can recommend you only workaround: database boolean field can't be after field, which can contain null values.
    This bug will be fixed in next version as well as in next patch.
  • Avatar
    axetheaxe
    0
    Comment actions Permalink
    We successfully used the mentioned workaround: we generate all boolean types first in the list of attributes.
    But we had to face one problem with this: It was possible that nullable columns occured as the last column of a row which results in an error with the following line (as it contains a boolean type in the first column). So we had to take care, that no nullable field is the last in the row.

    Alex

Please sign in to leave a comment.