Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I'm looking for log successes and errors after using a tDBRow (see screenshot).
The problem is that during the first iteration, errors and successes are both not null (next iteration are ok).
Here is the code of the first tJava :
if (errors == null) { System.out.println("################## Success"); } System.out.println("---------------" + (String) globalMap.get("currentTableToFlush")); System.out.println(errors == null ? "Errors is null" : "Errors is not null"); System.out.println(successes == null ? "Successes is null" : "Successes is not null");
of the second one :
if (errors != null) { System.out.println("################## Error"); }
and the result ("null" database name is volontary used to generate an error) :
############## DELETE FROM null.wrk_import ---------------wrk_import Errors is not null Successes is not null ################## Error ############## DELETE FROM null.wrk_deviationexplanation ---------------wrk_deviationexplanation Errors is not null Successes is null ################## Error ############## DELETE FROM null.wrk_projectimprovment ---------------wrk_projectimprovment Errors is not null Successes is null ################## Error
One more question : is there a way to use a computed parameter in tWarn priority ?
What is the success message in the first iteration? Did you try using a tDBOutput component instead? You could also keep a counter and just handle the first row specially.
I don't think you can set the priority in a tWarn with a variable.
I can't (or don't know how) use a tDBOutput, table structures are completly different (no common field).
What do you mean by "success message" ?
On success :
- resultSet/success is a single but null value flow
- error is an empty flow
.---------. |tLogRow_1| |=-------=| |resultSet| |=-------=| |null | '---------' .------------+---------+------------. | tLogRow_4 | |=-----------+---------+-----------=| |tableToFlush|errorCode|errorMessage| |=-----------+---------+-----------=| '------------+---------+------------'
On error :
- resultSet/success is an empty flow
- error is a single line with corresponding error
.---------.
|tLogRow_1| |=-------=| |resultSet| |=-------=| '---------' .------------+---------+-------------------------------------------------. | tLogRow_4 | |=-----------+---------+------------------------------------------------=| |tableToFlush|errorCode|errorMessage | |=-----------+---------+------------------------------------------------=| |null |42S02 |Table 'delivery_ods.null' doesn't exist - Line: 0| '------------+---------+-------------------------------------------------'
And "ERROR_MESSAGE" is always null.
Nobody?
What type are the variables successes and errors? What is the value of the resultSet of the success row on the first execution of malformed SQL?
Can you show the schema of the tDbRow component?
Thanks for your reply. All requested elements in attached screenshots.