Neal Scarr
Active Member
Does anybody know if it is possible to use the jde_deletetable api to delete records from two joined tables? Looking at the api documentation it mentions joins in the idInstance parameter but I can’t find any examples of how to use it this way.
I think you can do a jdb_OpenTable with no index specified and then a jdb_SetSelection on the request handle and then finally a jdb_DeleteTable to delete the selected records from a single table but I’m not sure about joined tables.
What I’m trying to achieve is to delete records from two tables with a certain data selection, but unfortunately the second table doesn’t contain the field I want to select on. Currently I’m having to read the first table in a loop for the data selection and then delete the matching records inside the loop from the second table, but this is not very efficient and both tables could potentially have a large number of records.
I’ve also tried to delete the records using a joined business view but this didn’t work as the generated SQL was incorrect (I think this is a limitation of the toolset).
I'm currently trying this on 9.0 TR 9.1.5.3
Any help would be greatly appreciated.
Thanks,
Neal
I think you can do a jdb_OpenTable with no index specified and then a jdb_SetSelection on the request handle and then finally a jdb_DeleteTable to delete the selected records from a single table but I’m not sure about joined tables.
What I’m trying to achieve is to delete records from two tables with a certain data selection, but unfortunately the second table doesn’t contain the field I want to select on. Currently I’m having to read the first table in a loop for the data selection and then delete the matching records inside the loop from the second table, but this is not very efficient and both tables could potentially have a large number of records.
I’ve also tried to delete the records using a joined business view but this didn’t work as the generated SQL was incorrect (I think this is a limitation of the toolset).
I'm currently trying this on 9.0 TR 9.1.5.3
Any help would be greatly appreciated.
Thanks,
Neal