Skip to main content

Deleting from mulitple tables - quick qu

  • August 4, 2015
  • 1 reply
  • 8 views

PhilBaker

Is there a way to delete data from multiple tables in a schema in a single command? We're looking for something like this:

 

delete from schema_name.* where ...

 

At the moment we either gather a list of all tables and write a separate delete statement for each one, or create a bash scripted loop.

 

Many thanks in advance for any advice.

1 reply

SruthiA
Forum|alt.badge.img+1
  • Participating Frequently
  • August 4, 2015

Hi,

 

    Unfortunately, there is no way to delete data from more than one table using delete command. As mentioned by you, a bash script can achieve it.

 

 

-Regards,

 Sruthi