0

Using MySQL 8.0.21, Delphi 10.2 and FireDAC, how can I structure the following so that "if exists" doesn't cause an error?

ihQuery.SQL.Clear;
ihQuery.SQL.Add( 'drop index patno if exists on records' );
ihQuery.ExecSQL;

Thanks, Jim Sawyer

fpiette
  • 11,983
  • 1
  • 24
  • 46
Jim Sawyer
  • 21
  • 2
  • Have you seen the answers to this question: https://stackoverflow.com/questions/2480148/how-can-i-employ-if-exists-for-creating-or-dropping-an-index-in-mysql – fpiette Oct 02 '20 at 15:18
  • Does this answer your question? [How can I employ "if exists" for creating or dropping an index in MySQL?](https://stackoverflow.com/questions/2480148/how-can-i-employ-if-exists-for-creating-or-dropping-an-index-in-mysql) – Metabolic Oct 02 '20 at 18:27

0 Answers0