Case statements will support raise exception or not?

postgresql

Solution

Best I'm aware, it won't. The `case` operator is for expression branching, as in one-liner statements that returns a value. For more complicated things and raising exceptions, use `if … then … end if;`.

Problem

``` case when $1 is null then raise exception 'Please enter $1' when $2 is null then raise exception 'Please enter $2' end; ``` Is it will work please can any give me answer

Original source