Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> AW: VLDB, Sequence and Sql*loader
Hi
Let's say, you want one sequence per table for a surrogate key. I would apply the id not from a sequence right away, but let SQL*LOADER do it. Then, create the sequence after the load with an initial value of whatever the maximum+1 for id is.
I load my tables like this:
LOAD DATA CHARACTERSET 'WE8EBCDIC500' BYTEORDER BIG ENDIAN INFILE 'blah' "FIX 14"
BADFILE 'blah.bad'
DISCARDFILE 'blah.dsc'
REPLACE
INTO TABLE SHABRV.RABRECHNUNGSKTO
(
ID SEQUENCE(1), ZID_ABRKTO POSITION(1:8) DECIMAL(15,0), ZABRKTONR POSITION(9:14) DECIMAL(10,0) )
Stefan
-----Ursprüngliche Nachricht-----
Von: NGUYEN Philippe (Cetelem) [mailto:philippe.nguyen_at_cetelem.fr]
Gesendet: Mittwoch, 21. Mai 2003 12:47
An: Multiple recipients of list ORACLE-L
Betreff: VLDB, Sequence and Sql*loader
Hi Gurus !
What are the best practises for inserting rows with sql*loader and
generating an id for each row (eg: flat file contains 3 column, and
destination table contains 4 )
TIA
Philippe
-- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Stefan Jahnke INET: Stefan.Jahnke_at_bov.de Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-LReceived on Wed May 21 2003 - 06:46:55 CDT
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).