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
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;
.
You can verify on sqlfiddle.com if you like. I did, and it certainly did not work in postgres. Raise is a pl/pgsql command, not an sql command.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With