Page 1 of 1

Raise Notice in Function

Posted: Wed 23 Feb 2005 07:46
by Gru
hello

how can i get back an RAISE NOTICE from a function?

a sample of the function:

Code: Select all

CREATE OR REPLACE FUNCTION "public"."friedl" () RETURNS integer AS
$body$
begin
  raise notice 'error is on';
  return 0;
end;
$body$
LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER;

Posted: Thu 24 Feb 2005 10:56
by Yuri
You can use PgSqlConnection.InfoMessage event.
Sample:

Code: Select all

private void OnInfoMessage(object sender, PgSqlInfoMessageEventArgs args) {
    
      MessageBox.Show(args.Message);
 }
private void Test() {
    ...
    pgSqlConnection.InfoMessage += new PgSqlInfoMessageEventHandler(OnInfoMessage);
    ...
    command.ExecuteNonQuery()
}