Jump to content
We've recently updated our Privacy Statement, available here ×

tMysqlOutput treat a failed INSERT as error?


mcandea

Recommended Posts

The end of my data flow is a tMysqlOutput component. Now, I want get an error in my job if one of the INSERT in this component fails for some reason, to report it to the user somehow.

Unfortunately it seems a failed INSERT is not an error condition in tMysqlOutput. Can the component be configured as such?

Thanks in advance!

Link to comment
Share on other sites

  • 1 month later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi, i've tried to reproduce your situation.

/userfiles/1.jpg

I get data from xml file

<?xml version="1.0" encoding="ISO-8859-15"?>

<account>
  <row>
    <id>1</id>
  </row>
</account>

this id=1 sets into table1_test.id (tinyint) - so it should work

Starting job test_job2 at 18:05 05/04/2009.
1
Job test_job2 ended at 18:05 05/04/2009. [exit code=0]

Then I try an incorrect data (string value set to tinyint)

<?xml version="1.0" encoding="ISO-8859-15"?>

<account>
  <row>
    <id>test</id>
  </row>
</account>

The result is

Starting job test_job2 at 19:39 05/04/2009.
Exception in component tMysqlOutput_1
java.sql.SQLException: Incorrect integer value: 'test' for column 'id' at row 1
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1056)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:957)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2938)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1601)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1710)
    at com.mysql.jdbc.Connection.execSQL(Connection.java:2436)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1402)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1694)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1608)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1593)
    at first_java_project.test_job2.test_job2.tFileInputXML_1Process(test_job2.java:409)
    at first_java_project.test_job2.test_job2.runJobInTOS(test_job2.java:765)
    at first_java_project.test_job2.test_job2.main(test_job2.java:681)
===========INSERT ERROR==========
Job test_job2 ended at 19:39 05/04/2009. [exit code=0]

"===========INSERT ERROR==========" it's a die message, so seems like the flow works for me.

 

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...