I have developed 1 apex page where I have one text field. I will insert multiple values by separating it through a comma. I want that when I hit the submit button then it should separate the values on the basis of comma and should insert individually in different rows. For example if I pass "abc,cde,efgh,ijhk,gygg" in my textfield then it should insert "abc" in one row,"cde" in another row and so on. and also it should not through any error when I insert only one value.
I am able to store the value for only one data as I have created a procedure and that procedure takes only one data but I am not getting an idea of if I pass multiple values by separating it via comma then it should insert. I am posting my procedure here.
create or replace procedure Exclude_items(
p_analyze_name in varchar2,
p_material_number in varchar2
)
as
p_analyze_id number;
begin
select analyze_id
into p_analyze_id
from analyzes
where table_name = p_analyze_name;
insert into p20da.test_vishal(ANALYZE_ID,MATNR,) values(p_analyze_id,p_material_number)
end;
Here matnr will be having multiple values separated by comma as it is a text field in apex page but analyze_id will be constant.
I want to write the procedure so that it could separate whenever a comma comes and should not through any error if I only insert one value.