/*alter table schematics
add type_id NUMBER;*/
begin
for i in (
select a.id,
substr(a.key,
instr(a.key, '|') + 1,
(instr(a.key, '|', 1, 2) -
(instr(a.key, '|', 1, 1) + 1))) TYPE_ID
from schematics a)
loop
update schematics
set type_id = TYPE_ID;
end loop;
)
end
/*alter table schematics
add type_id NUMBER;*/