clear markdown compare help best fiddles feedback dbanow.uk
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 2805483 fiddles created (40797 in the last week).

create table tab (name varchar2(30), type varchar2(30));
 hidden batch(es)


DECLARE l_stuff json_array_t; BEGIN l_stuff := json_array_t ('["Stirfry", "Yogurt", "Apple"] '); FOR indx IN 0 .. (l_stuff.get_size - 1) LOOP INSERT INTO tab (name, type) VALUES (l_stuff.get_string(indx), 'TEXT'); END LOOP; END; /
ORA-40573: Invalid use of PL/SQL JSON object type. ORA-06512: at line 6
 hidden batch(es)


DECLARE l_stuff json_array_t; l_name tab.name%type; BEGIN l_stuff := json_array_t ('["Stirfry", "Yogurt", "Apple"] '); FOR indx IN 0 .. (l_stuff.get_size - 1) LOOP -- assigfn to variable - bug 28901431 l_name := l_stuff.get_string(indx); INSERT INTO tab (name, type) VALUES (l_name, 'TEXT'); END LOOP; END; /
1 rows affected
 hidden batch(es)


select * from tab;
NAME TYPE
Stirfry TEXT
Yogurt TEXT
Apple TEXT
 hidden batch(es)