Page 1 of 1

How to obtained raise notice with unidac components:

Posted: Thu 22 Jul 2010 15:02
by niton_dev
I would like to know how to I can to obtained message of raise notice using TUniConnection and TUniSQL or TUniQuery components with postgresql 8.4.2. and Codegear Delphi 2007. It's possible?

Example

I have this functions:

CREATE OR REPLACE FUNCTION TEST() RETURNS TRIGGER AS
$BODY$
BEGIN
RAISE NOTICE 'TEST OF RAISE NOTICE';
RETURN NEW;
END;
$BODY$
LANGUAGE 'PLPGSQL';

CREATE TRIGGER TEST_CONSUMER
BEFORE INSERT OR UPDATE
ON CONSUMER
FOR EACH ROW
EXECUTE PROCEDURE TEST();

I need to obtained message of raise notice when I insert or update the consumer table.

Please ignore any errors, if any in postgresql function.

Thanks for help me.

Posted: Mon 26 Jul 2010 09:12
by bork
Hello

To get the Notice messages from the PostgreSQL server you should use the OnNotice event of TPgConnection.

Posted: Mon 26 Jul 2010 12:00
by hughespa
Is there a way to do this with UniDAC components though?

Regards, Paul.

Posted: Mon 26 Jul 2010 14:45
by bork
The PostgreSQL notice message is a PostgreSQL feature and is not supported by UniDAC. We plan to implement the possibility of handling warning or notice messages by UniDAC, but it is in the investigating phase only.

Posted: Tue 27 Jul 2010 02:48
by hughespa
It would be very useful.

Regards, Paul.