Re: Unique sequence number per datafile using SQL Loader

From: gazzag <gareth_at_jamms.org>
Date: 25 Oct 2006 09:07:26 -0700
Message-ID: <1161792446.364893.179560_at_k70g2000cwa.googlegroups.com>


radhika.penagonda_at_gmail.com wrote:
> Here's the requirement:
>
> I have a datafile with say 500 records to be loaded. Each time I load
> the file, I need to generate a sequence number unique to the file,
> which means all the 500 records loaded from that file should have the
> same sequence number.
> The next file to be laoded will have another unique number.
> I thought of using to_number(to_char(sysdate, 'YYYYMMDDHHMMSS') for a
> unique sequence. however, this does not generate one unique number for
> a file.
>
> Is there any other way to handle this requirement in the control file
> itself.

Look into using Oracle sequences.

http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_6015.htm#i2067093

HTH -g Received on Wed Oct 25 2006 - 18:07:26 CEST

Original text of this message