Five Stars

Delete cascade

I have a job whi9ch performs a delete operation. in postgresql db output, delete as option selected & deletion key selected.
Somehow the delete doesnt work.
I guess the reason might be key dependency on other tables as key value.
So is there a delete cascade facility in talend.
(I am using Integration suite)
Regards,
Jugal
6 REPLIES
Community Manager

Re: Delete cascade

Hi
No, it is impossible with tPostgresqlOutput component, you need to disable the constrain, like dropping the foreign key constraint before deleting and execute the SQL statement on tPostgresqlRow component.
Best regards,
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
Five Stars

Re: Delete cascade

Hi.
can i write the on delete cascade sql in postgresqlrow component without dropping the constraint ??
Community Manager

Re: Delete cascade

Hi
Maybe, I did't do it before, you can try the suggestion mentioned on the following URL and let me know the result,
http://stackoverflow.com/questions/129265/cascade-delete-just-once
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
Five Stars

Re: Delete cascade

hi,
how do i use the input coming out of tmap ?
job is like this
db2i/p > tmap > postgresqlo/p (Action on data : delete)
Now i change it to :
db2i/p > tmap > postgresrow
how do i use the id coming out of tmap to map query in postgresrow, i cant use
delete from xxx where uid=row5.xxxxxx ??
Five Stars

Re: Delete cascade

Still not working,
After removing constraint
I tried, in Row component : DELETE FROM table where id="+globalMap(map_delete.id)
Any Idea ?
Thanks,
Jugal
Five Stars

Re: Delete cascade

I also tried with context variable like:
DELETE FROM table where id="+context.uid
I set the context variable between tmap & row component.
but still not working ??
Any Help....