Get Warning Messages

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
John Bell
Posts: 17
Joined: Mon 25 Sep 2006 17:38

Get Warning Messages

Post by John Bell » Wed 04 Nov 2015 01:03

How do I retrieve any warning messages (not errors)? Am trying to detect if a temporary table exists. Thanks.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Get Warning Messages

Post by ViktorV » Fri 06 Nov 2015 16:56

To resolve the issue, you can use the following code:

Code: Select all

 MyQuery1.Sql.Text := 'SET sql_notes = 1; 
  CREATE TEMPORARY TABLE IF NOT EXISTS TEST (C CHAR(20)); 
  SHOW WARNINGS;';
MyQuery1.Open;
ShowMessage(MyQuery1.FieldByName('Message').AsString);

Post Reply