Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
_AnonymousUser
Specialist III
Specialist III

How to retrieve getNextException ?

During our integration process, we are inserting data into a postgresql table (tPostgreSQLOutput)
If, for any reason (violated FK, null inserted in a not nullable field, etc ...), the insert fails, we are shown a message telling us to call "getNextException",
How can we actually call this method ? (I don't mind having to modify the javanet files of the component if I have to). As it stands, we have no method at all to tell what is the error that is crashing the insert, and this is cripling our developpement.
Thank you
Labels (3)
14 Replies
_AnonymousUser
Specialist III
Specialist III
Author

Problem is with the schema , make sure that schema is correct and more over in target datatypes must be higher or equal in their respective source columns, and cross check with not null columns, they should have default values or provide any value in transformation. In my case i have used 0000-00-00 for purchasedate or handle in tmap as if(purchasedate = null , 'default(0000-00-00)' , purchasedate )
Anonymous
Not applicable

HI all,
I want to load data into a postgresql database but when I execute the job the error message appears
Best regards,
0683p000009MDQE.png
Anonymous
Not applicable

You could use a workaround:
after your tPostgresqlOutput send the flow to a tJavaFlex component.
--> tPostgresqlOutput --main flow--> tJavaFlex
In the Begin part of tJavaFlex write:
try {

In the End part of the tJavaFlex write:
} catch (Exception e) {
if (e instanceof java.sql.SQLException) {
java.sql.SQLException ne = ((java.sql.SQLException) e).getNextException();
if (ne != null) {
throw new Exception(e.getMessage() + ", next message:" + ne.getMessage(), e);
} else {
throw e;
}
} else {
throw e;
}
}
Anonymous
Not applicable

Hi jlolling,
As you have mentioned unchecking batch size is not always the solution, do you suggest anything else for it.
I am loading huge no of records so unchecking batch size is not an option for me.
while running the job in the production If i have to figure out the exact error,can you help me with that.
asheppardwork
Creator
Creator

thank you, thank you, thank you, was trying for an hour to find out how to get this stupid message and then found it was a typo in a field name.