我是甲骨文的初学者。
我一直在尝试读取文本文件并将其数据插入 utl_file 但无法这样做,因为我不了解以下内容:
Comma1 := INSTR(f_line, ',' ,1 , 1);
Comma2 := INSTR(f_line, ',' ,1 , 2);
Comma3 := INSTR(f_line, ',' ,1 , 3);
Comma4 := INSTR(f_line, ',' ,1 , 4);
Comma5 := INSTR(f_line, ',' ,1 , 5);
f_empno := to_number(SUBSTR(f_line, 1, Comma1-1));
f_ename := SUBSTR(f_line, Comma1+1, Comma2-Comma1-1);
f_job := SUBSTR(f_line, comma2+1, Comma3-Comma2-1);
f_mgr := to_number(SUBSTR(f_line, comma3+1, Comma4-Comma3-1));
f_hiredate := to_date(SUBSTR(f_line, comma4+1, Comma5-Comma4-1),'dd-mon-yyyy');
f_sal := to_number(SUBSTR(f_line, comma5+1),'99999');
dbms_output.put_line(f_empno ||' '|| f_ename || ' ' || f_job || ' ' || f_mgr || ' ' || f_hiredate || ' ' || f_sal);
insert into emp12 VALUES (f_empno,f_ename,f_job,f_mgr,f_hiredate,f_sal);