Home » SQL & PL/SQL » SQL & PL/SQL » Import a file
Import a file [message #19838] Fri, 12 April 2002 04:20 Go to next message
Younes
Messages: 3
Registered: April 2002
Junior Member
Hello,
I want to import a text file into a table in Oracle 8i.
In order to load fixed format fields, i have to create a control file which looks like this:
LOAD DATA
INFILE 'load.dat'
INTO TABLE emp
(empno POSITION(01:04) INTEGER EXTERNAL,
ename POSITION(06:15) CHAR,
job POSITION(17:25) CHAR,
mgr POSITION(27:30) INTEGER EXTERNAL,
sal POSITION(32:39) DECIMAL EXTERNAL,
comm POSITION(41:48) DECIMAL EXTERNAL,
deptno POSITION(50:51) INTEGER EXTERNAL)
I save this as: load.ctl in the path c:
The problem is that when i want to execute it in SQL by putting @c:load.ctl; it does not work. It says that the commande is unknown...
Also when i want to invoke the SQLloader (sqlldr userid=scott/tiger control=c:load.ctl log=load.log), it does not work... What do i have to put inside the log file? Doesn't the database create the log file once it receives the control file and the data file via sqlloader? Which utility of Oracle do i have to use if SQL* does not understand this kind of commands?
Could you please help me so that i can import a text file into a table of my database.
Thank you very much in advance
Younes
Re: Import a file [message #19839 is a reply to message #19838] Fri, 12 April 2002 05:50 Go to previous message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
check PATH variable.
include your ORACLE_HOMEbin in the path.
else give the complete path for your ctl,log and dat files and execute it from ORACLE_HOMEbin.
Previous Topic: unsubscribe
Next Topic: How can I get rid of the same records and reserve only one of them in a table.
Goto Forum:
  


Current Time: Fri Apr 19 17:50:15 CDT 2024