Import from text file

From: Ned <73613.3133_at_compuserve.com>
Date: Wed, 4 Jun 2003 12:19:17 -0400
Message-ID: <bbl6bp$go4$1_at_ngspool-d02.news.aol.com>


I am using SQL*Plus: Release 9.2.0.1.0 & Oracle8i Enterprise Edition Release 8.1.7.4.0. The client pc is running Windows NT 4.x. I am new to Oracle and recently attended an introductory class in Oracle 8i. I want to recreate the database tables I used in the class to do the practice excercises. I wrote the script below to create one of the tables and load it with data. I realized that I do not want to place a list of INSERT INTO statements in my code and would rather import the data from a text file (or and MS Excel file). Is it possible to read data from my pc drive in a PL/SQL program? How would I do this?

Thanks,

Ned

ACCEPT User CHAR FOR A3 PROMPT 'Enter your initials please... '

CREATE TABLE emp_&User
 (empno NUMBER(4) NOT NULL,
 ename VARCHAR2(10),
 job VARCHAR2(9),
 mgr NUMBER(2),
 hiredate DATE,
 sal NUMBER(7,2),
 comm NUMBER(7,2),
 deptno NUMBER(2) NOT NULL );

INSERT INTO emp_&User(empno, ename, job, mgr, hiredate, sal, comm, deptno)  VALUES (7839,'KING','PRESIDENT', NULL, '17-NOV-81', 5000, NULL, 10); INSERT INTO emp_&User(empno, ename, job, mgr, hiredate, sal, comm, deptno)  VALUES (7698,'BLAKE','MANAGER', NULL, '01-MAY-81', 2850, NULL,30); Received on Wed Jun 04 2003 - 18:19:17 CEST

Original text of this message