Hello,
I have a file and insert row in a mysql table.
After it, i want get for each row the insert id because i need it for many associated tables.
I have tryed TMysqlLastInsertId with this example
https://community.talend.com/t5/Design-and-Development/resolved-MySQL-last-insert-id/td-p/1775
but if i understand it give only last insert id of previous job and in more i don't unsertand why i insert 166 rows and lastinsertid give me id = 101.
Same if it works i have many tables as it so can't use this method i think. So please there is not another good way for it?
Bonjour,
J'insère des lignes d'un fichier dans une table MYSQL.
Pour ces lignes certaines colonnes sont insérées dans une table et d'autres dans d'autres tables en prenant soin de récupérer l'ID inséré dans la première table.
Pour cela j'ai essayé la solution donné ici
https://community.talend.com/t5/Design-and-Development/resolved-MySQL-last-insert-id/td-p/1775 mais je ne comprends pourquoi le lasinsert id retourné est toujours 101 alors que le job me met bien 166 enregistrements en table.
De plus cette méthode ne m'est pas pratique du tout car je dispose d'un certain nombre de tables associées et je ne vais pas scanner pour chaque table le même fichier en incrément à partir de l'id de début que j'aurai pu obtenir, ce pour toutes les tables dont j'ai besoin. N'auriez vous donc pas s'il vous plait une méthode qui me serait plus appropriée ? et pourquoi LastInsert Id me retourne une valeur inférieur, de plus ((Integer)globalMap.get("tMysqlOutput_3_NB_LINE")) me retourne 0.