EPUB | CHM | PDF

TDatabase.Events.OnNotice

Top Previous Next

Occurs when server sends notices to an application.

Syntax:

type
  TDatabaseNoticeEvent = procedure (Sender: TPSQLDatabase; Message: string) of object;
property OnNotice: TDatabaseNoticeEvent;

Description:

Write an OnNotice event handler to take application-specific actions immediately after server notice are sent. Verbosity level you can change by setting client_min_messages server parameter. Check PostgreSQL help for details.

Example:

Example shows how to make simple log.

procedure TForm1.PSQLDatabase1Notice(Sender: TPSQLDatabase;
  Message: String);
begin
 logMemo.Lines.Append(DateTimeToStr(Now) + Trim(Message));
end;