I’m developing an app using Oracle 11g and ODP.NET, C# and I’m a beginner in Oracle stored procedures.
What I need is to write a stored function that will delete a record from a table.
Let’s say function fu_delete_user(p_user_id) that deletes the user with that id from table Users. But, maybe due to a constraint, the delete statement threw an exception. In this case I want the function to return false, else it should return true.
How should I write this function / call it from c# ?
Thank you!
Here is an idea of the code, it would be better in your case to use a function as they are designed to always return a value.
Procedures can return values through
OUTparameters (as in the example I have given).Using a function:
Using a procedure:
Hope it helps…