Home » RDBMS Server » Server Utilities » SQL LOADER sequence
SQL LOADER sequence [message #72420] Thu, 12 June 2003 01:05 Go to next message
Jayati Raychaudhuri
Messages: 1
Registered: June 2003
Junior Member
For 1 input data of a flat file I have to insert 96 row in a table. amd for this 96 data I want a sequence no. I could use db sequence for this. But my volume of data is very large. So I have to use DIRECT- "TRUE". I that case I am not able to use DB_SEQUENCE. What may be the solution in this case.
Re: SQL LOADER sequence [message #72422 is a reply to message #72420] Thu, 12 June 2003 06:02 Go to previous message
Mahesh Rajendran
Messages: 10708
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
load the data into a temp table as it is.
then
insert into the target table from temp table along with the sequence.no.
-- target table
mag@itloaner1_local > create table jk
  2  (id number,
  3   ename varchar2(14));

Table created.
-- sequence
mag@itloaner1_local > create sequence asf
  2  start with 1
  3  increment by 1;

Sequence created.

- let emp be the temp table which you have loaded.
mag@itloaner1_local > ed
Wrote file afiedt.buf

  1* insert into jk (select asf.nextval,ename from emp)
mag@itloaner1_local > /
mag@itloaner1_local > select * from jk;

        ID ENAME
---------- --------------
         1 SMITH
         2 ALLEN
         3 WARD
         4 JONES
         5 MARTIN
         6 BLAKE
         7 CLARK
         8 SCOTT
         9 KING
        10 TURNER
        11 ADAMS
        12 JAMES
        13 FORD
        14 MILLER
        15 SMITH
        16 ALLEN
        17 WARD
        18 JONES
        19 MARTIN
        20 BLAKE
        21 CLARK
        22 SCOTT
        23 KING
        24 TURNER
        25 ADAMS
        26 JAMES
        27 FORD
        28 MILLER

28 rows created.

Previous Topic: exploring commit statement!
Next Topic: SQL*Loader-704: Internal error: ulconnect: OCIInitialize [1804]
Goto Forum:
  


Current Time: Thu Nov 07 22:29:53 CST 2024