0

Using DataJoint Python (0.12.9) on Ubuntu with MySQL 5.7 .

Am running into an error with what I believed to be a fairly standard operation.

Have a table named Table with a part Table.Part.

Restricting Table as such:


Table & Table.Part

gives me the entries in Table common to Table.Part. However, wrapping this in a delete statement (either delete or delete_quick) as such:

(Table & Table.Part).delete()

gives me the following error:

OperationalError: (1093, "You can't specify target table '#table__part' for update in FROM clause")

Do not understand why "target table" is '#table__part' here, when I am attempting to delete from '#table'.

RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
spapadop
  • 51
  • 5

1 Answers1

0

Perhaps this would work

(Table & (Table & Table.Part).fetch('KEY')).delete()

"target table" is "#table__part" is likely because you are also deleting entries from the Table.Part table as well (cascade delete)