• Index
  •  » Talend Open Studio for Data Integration » Component creation
  •  » How to delete data from mysql table after its exported into csv file

#1 2011-11-15 06:57:46

asa436
Member
Registered: 2011-09-19
Posts: 21

How to delete data from mysql table after its exported into csv file

Want to delete data from file in mysql table after its exported into csv file;
The process image is given with this topic please guide me the way to do deletion from my sql table when complete data is exported to csv file ...
i do this as
tsetglobalvar->tmysqlconnection->tmysqlinput->tmap->touputdelimeted file
set coutner variable as 1,
@tMap 2 links goes out 1 contained full attributes for csv file and other contain only Primary key on basis we perform delete(DWHid and in tmap get variable in column name seq-row as (integer)globalmap.get("counter)"...2 columns) and
get this row using tjavarow and put it in context variables var_DWHID and linked it with tmysqltrow along with query
"DELETE  FROM table_name WHERE   DWHId ="+context.Var_DWHId
or try to do without variable as
"DELETE  FROM accountcn WHERE   DWHId ="\""+row3.DWHId+"\""

Error occurred as
nb_line in tJavarow cannot be resolved to a variable
stmt_tMysqlRow cannot be resolved....

also guide me if i want to delete only those record who are exported into csv file


Uploaded Images

Offline

#2 2011-11-21 09:58:52

garpitmzn
Member
Registered: 2011-07-25
Posts: 18

Re: How to delete data from mysql table after its exported into csv file

"DELETE  FROM accountcn WHERE  DWHId = "+row3.DWHId should work.

Offline

#3 2011-12-19 07:04:38

MillerLee
New member
Registered: 2011-12-19
Posts: 1

Re: How to delete data from mysql table after its exported into csv file

Where should wright the destination value?

Last edited by MillerLee (2011-12-19 07:05:38)

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Component creation
  •  » How to delete data from mysql table after its exported into csv file

Board footer

Powered by FluxBB