I have an oralcle SP forced on me that will not accept an empty parameter in an update. So if I wanted to set a value back to the default of (”) it will not let me pass in the empty string. Is there a keyword you can use such as default, null, etc that oracle would interpret back to the default specified for a particular column?
Share
Sometimes things are just as simple as you hope they might be.
First, a table with a default value …
Next a procedure which updates the default column …
… but which doesn’t work as we would like:
So, let’s try adding a DEFAULT option …
… and lo!
I ran this example on an 11g database. I can’t remember when Oracle introduced this exact support for DEFAULT, but it has been quite a while (9i???)
edit
The comments are really depressing. The entire point of building PL/SQL APIs is to make it easier for application developers to interact with the database. That includes being sensible enough to rewrite stored procedures when necessary. The big difference between building something out of software and, say, welding cast-iron girders together is that software is malleable and easy to change. Especially when the change doesn’t alter the signature or behaviour of an existing procedure, which is the case here.