Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

PLSQL - Identify where a parameter value has been defaulted

John_KAug 21 2017 — edited Aug 21 2017

Following on from my question here: Procedure parameters - has been defaulted?

I think it would be really useful to be able to see in PL/SQL when the value of a parameter is such because that value has been defaulted, rather than explicitly set by the user user. I.e.

  1. create procedure x(a in varchar2 default null, b in varchar2 default null, c in varchar2 default null
  2. is 
  3. begin 
  4.   update xxtab set a1=a, b1=b, c1=c; 
  5. end

  1. x(a=>Null, c=>'Carrot'); 

I have no way in my code of knowing whether the user explicitly supplied Null for the a parameter, or whether it is null because of the default in the procedure spec. The reason being that it would make coding table handlers/API's a lot easier - we could do things differently if the user has explicitly requested a null value in a parameter, and ignore them if they haven't supplied that parameter. We can do this by defaulting dummy "out of range" values, but I find that a bit clumsy. I would like an isDefaulted function (or pseudo-property of a parameter).

Comments

Post Details

Added on Aug 21 2017
6 comments
541 views