Solved

NEED HELP WITH SQL LOADER

Posted on 2008-10-29
7
393 Views
Last Modified: 2013-12-19
Am in situation where i need to load the data from a text file to a table which i can do with sql loader
but how can we load the data if they are not in a fixed positions is it possible or not?
Exactly the problem is
format of the text file is attached below
the control file is as without date but i need the date also to be loaded in the table
LOAD DATA
replace
INTO TABLE xxxx
TRAILING NULLCOLS
(
    ID     POSITION( 1:9)    
  , EMAIL_TX         POSITION(10)    TERMINATED BY WHITESPACE
  )
can some one tell me how to include the date aswell in the control file or shud the file format be changed
thanks in advance
test.txt
0
Comment
Question by:gunners1219
  • 4
  • 3
7 Comments
 
LVL 29

Accepted Solution

by:
MikeOM_DBA earned 500 total points
ID: 22835342

Try this command with the attached controlfile:

sqlldr {id}/{pw} control=xxxx.txt


xxxx.txt
0
 

Author Comment

by:gunners1219
ID: 22835394
Thanks it works
0
 

Author Comment

by:gunners1219
ID: 22846709
I GET THIS ERROR CODE WHEN I RUN IT IN UNIX

LRM-00112: multiple values not allowed for parameter 'data'

BUT IT LOADING THE RECORDS CORRECTLY INTO THE XXX TABLE

hOW TO GET RID OF THIS ERROR AS THIS ERROR IS KILLING OTHER JOBS WHICH ARE SUPPOSED TO RUN AFTER THIS

0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 29

Expert Comment

by:MikeOM_DBA
ID: 22850777

Post your controlfile:
0
 

Author Comment

by:gunners1219
ID: 22850819
LOAD DATA
replace
INTO TABLE xxxx
TRAILING NULLCOLS
(
    ID     POSITION( 1:9)    
  , EMAIL_TX         POSITION(10)    TERMINATED BY WHITESPACE
  ,DT      DATE  ""MM/DD/YYYY""
  )
0
 
LVL 29

Expert Comment

by:MikeOM_DBA
ID: 22852727

The controlfile needs to be WITHOUT THE POSITION c.r.a.p. exactly like the following:

If your data is ins a separate file, then use the alternate control file:
LOAD DATA
INFILE *
REPLACE
INTO TABLE xxxx
FIELDS TERMINATED BY " " TRAILING NULLCOLS
-- This is a TAB -----^
(
    ID
  , EMAIL_TX
  , DATE_ASWELL   DATE "MM/DD/YYYY"
)
BEGINDATA
896114589	IE1423@YAHOO.COM	10/22/2008
856127527	lencia@comcast.net	10/22/2008
896155211	IBICK@AOL.COM	10/18/2008
895312588	DA0354@HOTMAIL.COM	10/17/2008
555318893	gross@hotmail.com	10/17/2008
789626076	partygirl@hotmail.com	10/18/2008
456752796	uygfyirg@AOL.COM	10/17/2008
123761614	vvv@hotmail.com	10/17/2008
--========== Alternate control file: ========================
LOAD DATA
INFILE 'MyFile.dat'
REPLACE INTO TABLE xxxx
FIELDS TERMINATED BY " " TRAILING NULLCOLS
-- This is a TAB -----^
(
    ID
  , EMAIL_TX
  , DATE_ASWELL   DATE "MM/DD/YYYY"
)

Open in new window

0
 

Author Comment

by:gunners1219
ID: 22852795
Its nt helping me
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Schema creation in Oracle12c 6 46
Oracle query output question 4 43
Why  don't I see Below columns in my  Stored Procedure  under TMP_RS? 8 22
Help on model clause 5 31
Article by: Swadhin
From the Oracle SQL Reference (http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm) we are told that a join is a query that combines rows from two or more tables, views, or materialized views. This article provides a glimps…
Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question