0

Are the multitable DELETE statements supported by HSQLDB?

I've done some searches on Google and in the forum, but can't find a topic that deals with this point.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
manash
  • 6,985
  • 12
  • 65
  • 125

1 Answers1

2

Not directly as of version 2.2.5.

But you can write a stored procedure to delete from multiple tables according to some criteria, then call the procedure with the necessary parameters. See the Guide:

http://hsqldb.org/doc/2.0/guide/sqlroutines-chapt.html

fredt
  • 24,044
  • 3
  • 40
  • 61
  • Can you give me a sample code of your solution? Also, on another post i've found this solution DELETE FROM T1 WHERE T1.C1 IN (SELECT T2.C2 FROM T2 WHERE ) What do you think on it? Thanks – manash Oct 27 '11 at 14:02
  • In the previous comment, i delete rows from T1 according to a condition on T2. That's exactly what I wanted to do. – manash Oct 27 '11 at 14:03
  • I wrote the other answer. If you use ON DELETE CASCADE, then it is a solution for you. – fredt Oct 27 '11 at 14:07
  • Oh, I didn't see the username. Thanks for your answers. – manash Oct 27 '11 at 14:10