insert oracle forms 6i [message #80622] |
Tue, 22 October 2002 08:25 |
daisy
Messages: 4 Registered: May 2002
|
Junior Member |
|
|
Hi everbody,
My code is here.I want to take categories value like '62,11,3,68' and i want insert categories one to one into table like
category_no category_name
62 a
11 b
3 c
68 d
declare
leng varchar2(100);
i number;
category varchar2(10);
CATEGORIES VARCHAR(250);
begin
CATEGORIES := '62,11,3,68';
select LENGTH(CATEGORIES)
into leng
from dual;
for i IN 1..to_number(leng) LOOP
SELECT substr(CATEGORIES,i,INSTR(CATEGORIES,',')-1)
into category FROM DUAL ;
if category = ',' then
null;
else
insert into category_table values(category,category_name);
end if;
END LOOP;
END;
|
|
|
|