Link to home
Start Free TrialLog in
Avatar of gunners1219
gunners1219

asked on

NEED HELP WITH SQL LOADER

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
ASKER CERTIFIED SOLUTION
Avatar of MikeOM_DBA
MikeOM_DBA
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gunners1219
gunners1219

ASKER

Thanks it works
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


Post your controlfile:
LOAD DATA
replace
INTO TABLE xxxx
TRAILING NULLCOLS
(
    ID     POSITION( 1:9)    
  , EMAIL_TX         POSITION(10)    TERMINATED BY WHITESPACE
  ,DT      DATE  ""MM/DD/YYYY""
  )

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

Its nt helping me