Five Stars

problem in import Excel to MySQL

Hi friends,

 

i'm new in talend and i want to know if there a solution to get error. Ex: when i run the job 1000 lines is in databse, but when i have error in line 1001 and i correct the error i want ton continu the job, one solution i have is truncat database and reflate the job and start in ligne 1 not 1001, i want to continu job in line 1001

 

thanks you

1 ACCEPTED SOLUTION

Accepted Solutions
Twelve Stars TRF
Twelve Stars

Re: problem in import Excel to MySQL

Hi,

You may include a status field in the Excel file and put a value (OK or KO) in this field field depending on the operation result.

Then when you read the Excel file, you just have to filter the input rows to exclude whose with status = OK.

You may also start with the your previous post (https://community.talend.com/t5/Design-and-Development/Insert-new-record-if-not-exist-in-database/m-...); add a primary key on the target table and ignore duplicate keys on insert (not too clean).

Finally, you may set the header field for the tFileInputExcel to 1001 other to ignore top records.

The number of records to be ignored can be defined using a context variable.

Just activate prompt on variable for the corresponding variable and you you will be prompted to enter a value for the variable when the job starts. 

 

Hope this helps.


TRF
3 REPLIES
Twelve Stars TRF
Twelve Stars

Re: problem in import Excel to MySQL

Hi,

You may include a status field in the Excel file and put a value (OK or KO) in this field field depending on the operation result.

Then when you read the Excel file, you just have to filter the input rows to exclude whose with status = OK.

You may also start with the your previous post (https://community.talend.com/t5/Design-and-Development/Insert-new-record-if-not-exist-in-database/m-...); add a primary key on the target table and ignore duplicate keys on insert (not too clean).

Finally, you may set the header field for the tFileInputExcel to 1001 other to ignore top records.

The number of records to be ignored can be defined using a context variable.

Just activate prompt on variable for the corresponding variable and you you will be prompted to enter a value for the variable when the job starts. 

 

Hope this helps.


TRF
Five Stars

Re: problem in import Excel to MySQL

Thanks you so much

Five Stars

Re: problem in import Excel to MySQL

I would like to have an error file/table where I would like to see something like below
rec_key|record|error_code|error_msg
Ex:
1|a;shong|NUMERIC_CHECK_FAILED|id has a bad value "a"
6|f;Lee|NUMERIC_CHECK_FAILED|id has a bad value "f"
22|h;nike|NUMERIC_CHECK_FAILED|id has a bad value "h"

how can i do it?