Follow Up
A reader, March 27, 2020 - 6:04 pm UTC
Thanks for the quick answer.
1. What do these values mean in the procedure? 1, 3, 9, 27, 81
2. Sorry, bur I did not understand this part
declare
vals n_arr;
begin
vals := n_arr ( 1, 3, 9, 27, 81 );
p ( vals );
end;
/
3. If I want to delete strings '12345' and '6789', how would I proceed?
Thanks in advanced.
March 30, 2020 - 12:05 am UTC
See paul comments below
a little more detail?
paul, March 27, 2020 - 7:32 pm UTC
The sample is showing you a simple way of doing this, just they used an array of numbers, not Strings
vals n_arr - declares that they will but a bunch of numbers into a Custom Type (n_arr) previously defined as a table of Numbers.
You would need to create a similar Table of type varchar2()
create or replace type n_arr
is table of varchar2(100);
They then create a Procedure using this Custom Type as a parameter.
create or replace procedure p ( vals n_arr ) as
begin
delete t
where id in (
select column_value from table ( vals )
);
end p;
in that procedure they can then use the IN clause against the custom type.
March 30, 2020 - 12:05 am UTC
thanks for helping out
Follow Up
Geraldo, March 30, 2020 - 12:44 am UTC
Thanks for the help. It was great!