Search Postgresql Archives

How to exit/abort from a function that returns VOID?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



HI,

I have a PLPgSQL function that return void but I need to exit the function if some condition returns true.

I have tried to do this, but I got an error:

[code]
        IF pVAL_CHAVE_2 > pVAL_CAMPO1 THEN
            RAISE NOTICE 'O campo data fim tem de ser maior que o campo data inicio.';
            RETURN 0;
        END IF;
[/code]

The error is the folowing:

[quote]
ERROR:  RETURN cannot have a parameter in function returning void at or near "0" at character 1973
[/quote]

My question. How can I display the NOTICE and exit the function?

Best Regards,

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux