给这个表建个触发器和一个sequence,触发器里把Myseq.nextval赋给:new.seq_no
load data
infile 'test.dat'
append into table test
(class_id constant XXX,
//seq_no , //不用
context position(1:2000)
)

解决方案 »

  1.   

    load data
    infile 'test.dat'
    append into table test
    (class_id constant XXX,
    seq_no RECNUM,
    context position(1:2000)
    )
    应该也可以
      

  2.   

    如果seq_no不要求唯一的话,用 RECNUM 足亦,而且效率很高。反之,如果 seq_no 要求唯一,则必须创建序列,然后这么用:load data
    infile 'test.dat'
    append into table test
    (context position(1:2000),
    class_id constant XXX,
    seq_no "SEQUENCEID.NEXTVAL"
    )这种效率比使用触发器要高很多。