Page 1 of 1

Get Warning Messages

Posted: Wed 04 Nov 2015 01:03
by John Bell
How do I retrieve any warning messages (not errors)? Am trying to detect if a temporary table exists. Thanks.

Re: Get Warning Messages

Posted: Fri 06 Nov 2015 16:56
by ViktorV
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);