Connecting Tech Pros Worldwide Forums | Help | Site Map

SQL Loader

antonopn's Avatar
Member
 
Join Date: Mar 2008
Posts: 42
#1: Feb 20 '09
Hello there,

I have a semicolon delimited text file (lets say 'c:\myfile.txt').

I want to insert it into a table in a 8.1.6 oracle database (lets say 'mydatabase.dbo.mytable')

I tried searching the internet for some scripts, but I get an error message "LOAD DATA not a recognised command" or something like this.

Could someone PLEASE help me? I'm a newbie in oracle. MS SQL procedure importing text files (bulk insert) is a lot easier in my opinion.

Thank you for your time...

debasisdas's Avatar
Moderator
 
Join Date: Dec 2006
Location: Bangalore ,India
Posts: 7,511
#2: Feb 20 '09

re: SQL Loader


try the following

Expand|Select|Wrap|Line Numbers
  1. load data
  2. infile 'd:\debasis\data.dat'
  3. insert
  4. into  table mydept
  5. fields terminated by  ";"
  6. (deptno,dname,loc)
  7.  
antonopn's Avatar
Member
 
Join Date: Mar 2008
Posts: 42
#3: Feb 20 '09

re: SQL Loader


Should I create the table before this procedure or not?

Thanks a lot debasisdas!!!!
debasisdas's Avatar
Moderator
 
Join Date: Dec 2006
Location: Bangalore ,India
Posts: 7,511
#4: Feb 20 '09

re: SQL Loader


yes table must exist before the laoding.

the code is not a procedure

you need to put that in a control file and execute that from command prompt
Reply

Tags
oracle, sql loader, txt