Raise Notice in Function

Raise Notice in Function

Postby Gru » Wed 23 Feb 2005 07:46

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;
Gru
 

Postby Yuri » Thu 24 Feb 2005 10:56

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()
}
Yuri
 
Posts: 140
Joined: Mon 08 Nov 2004 12:07


Return to dotConnect for PostgreSQL