Page 1 of 1

How to use LISTEN/NOTIFY with the UniDAC PostgreSQL provider

Posted: Wed 28 Dec 2011 22:20
by swierzbicki
Hello,

How to use LISTEN/NOTIFY with the UniDAC PostgreSQL provider ?
Can you please share any exemples ?

Posted: Thu 29 Dec 2011 11:06
by bork
Hello

For sending and getting notification, you should use TUniAlerter:

Getting:

Code: Select all

begin
  UniAlerter1.Events := 'pg_uni_alerter'; // any name
  UniAlerter1.Start;
end;
Sending:

Code: Select all

begin
  // second parameter is supported in PostgreSQL 9.0 and higher
  UniAlerter1.SendEvent('pg_uni_alerter', 'message'); 
end;