troubleshooting Question

read text file and insert into db

Avatar of bbvic
bbvic asked on
Oracle Database
8 Comments1 Solution2651 ViewsLast Modified:
So far, open and read a text file is ok...but...

1. how to insert into TEST table?
2. it should more than 2 rows

How to be inserted into TEST table??

---------------------------------------------------------------

DECLARE
f utl_file.file_type;
s varchar2(200);

BEGIN

f := UTL_FILE.fopen ('TESTDIR', 'test.txt', 'r');
LOOP
utl_file.get_line(f,s,7);
dbms_output.put_line(s);
utl_file.get_line(f,s,8);
dbms_output.put_line(s);
utl_file.get_line(f,s,9);
dbms_output.put_line(s);
utl_file.fclose(f);
-- INSERT INTO TEST (student_id,enroll_status,major) VALUES (s,s);
END LOOP;
END;
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros