sequence [message #73013] |
Wed, 14 January 2004 06:24 |
kim
Messages: 116 Registered: December 2001
|
Senior Member |
|
|
I have to load txt file in oracle table t.
I created the first column t_id as a sequence SEQ_T_ID.
When I load file I specify in *.ctl file "t_id sequence(count,1),"
Does this involved creating sequence automatically or
I Should create trigger on this column before insert as
BEGIN
select SEQ_t_id.nextval into :new.object_id from dual;
END;
|
|
|
Re: sequence [message #73014 is a reply to message #73013] |
Wed, 14 January 2004 16:37 |
|
Mahesh Rajendran
Messages: 10708 Registered: March 2002 Location: oracleDocoVille
|
Senior Member Account Moderator |
|
|
###this uses a database sequence
bash-2.03$ cat member.ctl
load data
infile 'member.dat'
insert into table member
fields terminated by ',' trailing nullcols
(
name,
address,
control_id integer "memberseq.nextval"
)
#### no database sequence is used. sequence is incremented by 1
bash-2.03$ cat member.ctl
load data
infile 'member.dat'
insert into table member
fields terminated by ',' trailing nullcols
(
name,
address,
control_id sequence(1,1)
)
#### no database sequence is used. sequence is incremented by 5
bash-2.03$ cat member.ctl
load data
infile 'member.dat'
insert into table member
fields terminated by ',' trailing nullcols
(
name,
address,
control_id sequence(1,5)
)
|
|
|