PostgreSQLDatabase.ReceivedNotification

From Xojo Documentation

Event


PostgreSQLDatabase.ReceivedNotification(aName As String, aPid As Integer, aExtra As String)

Supported for all project types and targets.

A notification named aName has been received. The process ID of the sender is passed in the aPid parameter.

Notes

Used by the Listen and Notify PostgreSQL feature.

To receive notifications, use the Listen method to specify the name of each notification to listen for and call the CheckForNotifications method (usually in a Timer).

Notifications are sent using the Notify method.

The aExtraparameter may contain payload information provided by another PostgreSQL system. Xojo does not have a way to provide a payload to a notification. as a workaround you can manually call NOTIFY yourself like this:

db.ExecuteSQL("NOTIFY ""UpdateCustomers"", '5, 10, 15'")

Sample Code

This code in the ReceivedNotification event handler displays the notification that was received:

MessageBox("Received notification: " + sName + " from " + aPid.ToString)