PACKAGE PKG_DEVICE AS
TYPE STR_ASSOC_ARR is table of VARCHAR(255) index by BINARY_INTEGER;
procedure proc_create_device
(
in_deviceid in raw
, in_devicecert in clob
, in_status in number
, in_caps in STR_ASSOC_ARR
, in_vals in STR_ASSOC_ARR
);
is the stored procedure declaration. I would like to specify a default value for the in_caps and in_vals parameters. Is it possible? I am not able to specify default null
as it doesn't work. My goal is to not have to pass these two parameters (or pass null) from C# when they are not available. If there is an odp.net way of accomplishing the same, that would work too.
Using oracle db 11g.
You need to cast NULL as the user defined type. Try this:
PACKAGE PKG_DEVICE AS
TYPE STR_ASSOC_ARR is table of VARCHAR(255) index by BINARY_INTEGER;
procedure proc_create_device
(
in_deviceid in raw
, in_devicecert in clob
, in_status in number
, in_caps in STR_ASSOC_ARR DEFAULT CAST(NULL AS STR_ASSOC_ARR)
, in_vals in STR_ASSOC_ARR DEFAULT CAST(NULL AS STR_ASSOC_ARR)
);
Now you should not have to specify values for in_caps or in_vals. If the values are not passed, they default to NULL values of the STR_ASSOC_ARRAY type.
And of course, you'll need to update the procedure declaration in the package body to correspond to these changes.
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