0

How is it possible to have the result of an sql query saved as another sql query, so that somewhere down the line , if a delete is made, it could be reverted back to the old data?

I was looking into making a system call. Something like this

system (mysql -uuser-ppassword -Ddatabase < select.sql > backup.sql

where select.sql is the intial query, and backup.sql is the final query. When i execute it, just get a datadump in backup.sql

Please Help

xlecoustillier
  • 16,183
  • 14
  • 60
  • 85
rsharma
  • 75
  • 1
  • 9

1 Answers1

0

Try using SQLyog (http://www.webyog.com/) to export a table as a series of insert statements. This should do what you want, although I'm not totally sure that it can export the results of a select statement with a where clause. It will allow you to choose which columns to export.

cja
  • 9,512
  • 21
  • 75
  • 129