Home » RDBMS Server » Server Utilities » How to skip last n no of records in sql Loader load (ORACLE 10gR2 linux)
How to skip last n no of records in sql Loader load [message #518326] Wed, 03 August 2011 03:06 Go to next message
9390512774
Messages: 103
Registered: January 2011
Location: hyd
Senior Member
Hi All

I have data file emp.dat in that i have 10000 records.
My requirement is i want to skip last 100 records when i am loading it into EMP table using SQL *LODER.
Please provide me a solution.

Thanks in advance
Re: How to skip last n no of records in sql Loader load [message #518329 is a reply to message #518326] Wed, 03 August 2011 03:13 Go to previous messageGo to next message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Have a look at SKIP option.

Regards
Michel
Re: How to skip last n no of records in sql Loader load [message #518336 is a reply to message #518329] Wed, 03 August 2011 04:11 Go to previous messageGo to next message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
SKIP makes it possible to, well, skip records at the beginning of the file, not at the end.

So ... maybe you could remove records you don't need BEFORE running SQL*Loader (i.e. delete them in a text editor)? Or, if you can distinguish those records from the others (by some kind of an ID or whatever), you might try with the WHEN clause. Or, instead of SQL*Loader, use external tables concept which provides larger flexibility.
Re: How to skip last n no of records in sql Loader load [message #518343 is a reply to message #518336] Wed, 03 August 2011 05:13 Go to previous messageGo to next message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Doh! I didn't see "last".

Regards
Michel
Re: How to skip last n no of records in sql Loader load [message #518382 is a reply to message #518336] Wed, 03 August 2011 08:11 Go to previous messageGo to next message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
Littlefoot wrote on Wed, 03 August 2011 05:11
SKIP makes it possible to, well, skip records at the beginning of the file, not at the end.


Then what about reversing the order of the data in the file and then use skip?
Re: How to skip last n no of records in sql Loader load [message #518387 is a reply to message #518382] Wed, 03 August 2011 08:21 Go to previous messageGo to next message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
That's the idea of the day! /forum/fa/2115/0/

Regards
Michel
Re: How to skip last n no of records in sql Loader load [message #518400 is a reply to message #518382] Wed, 03 August 2011 09:19 Go to previous message
LKBrwn_DBA
Messages: 487
Registered: July 2003
Location: WPB, FL
Senior Member
If you know the total number of records in the file, you could use:

LOAD n


Where n = total records - 100

[Updated on: Wed, 03 August 2011 10:11] by Moderator

Report message to a moderator

Previous Topic: Export import method
Next Topic: Clone Database user
Goto Forum:
  


Current Time: Thu Apr 18 13:58:52 CDT 2024