Ok, so as I'm writing my functions in plpgsql, I should be using exceptions.
DEBUG
NOTICE
EXCEPTION
I'm writing my functions to be called by a person writing in C#.
Let's say I have a function: sql_modify_user(user_id,first_name)
He calls it, but the user_id doesn't exist in the database. As the SQL programmer, I want him to know that his update didn't actually get stored in any user row. If he was running the SQL by hand, I could raise a notice. But I want his program to trap for this. How does he trap for this, and what does he do with it?
Before thinking about using exception handling, I was going to use different return values...but that's bad practice.
Would you guys lead me on a good path here?
Thanks.
DEBUG
NOTICE
EXCEPTION
I'm writing my functions to be called by a person writing in C#.
Let's say I have a function: sql_modify_user(user_id,first_name)
He calls it, but the user_id doesn't exist in the database. As the SQL programmer, I want him to know that his update didn't actually get stored in any user row. If he was running the SQL by hand, I could raise a notice. But I want his program to trap for this. How does he trap for this, and what does he do with it?
Before thinking about using exception handling, I was going to use different return values...but that's bad practice.
Would you guys lead me on a good path here?
Thanks.