|
|
|
|
|
Re: Issue with SQL LOADER Control file [message #668928 is a reply to message #668920] |
Fri, 23 March 2018 13:59 |
|
Barbara Boehmer
Messages: 9101 Registered: November 2002 Location: California, USA
|
Senior Member |
|
|
What joy division suggested does work, as demonstrated below.
SCOTT@orcl_12.1.0.2.0> host type feed_file.dat
No|Name|ID|Location|value
12|simple||Singapore|gold
34|barate|TEST|London|siler
45|sdfsdfs||America|diamond
SCOTT@orcl_12.1.0.2.0> host type test.ctl
load data
infile 'feed_file.dat'
into table oracle_table
fields terminated by '|' trailing nullcols
( no, name
, id "sequence.nextval"
, location, value)
SCOTT@orcl_12.1.0.2.0> create table oracle_table
2 (no number,
3 name varchar2(10),
4 id number,
5 location varchar2(10),
6 value varchar2(10))
7 /
Table created.
SCOTT@orcl_12.1.0.2.0> create sequence sequence
2 /
Sequence created.
SCOTT@orcl_12.1.0.2.0> host sqlldr scott/tiger control=test.ctl log=test.log
SQL*Loader: Release 12.1.0.2.0 - Production on Fri Mar 23 11:56:33 2018
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
Path used: Conventional
Commit point reached - logical record count 4
Table ORACLE_TABLE:
3 Rows successfully loaded.
Check the log file:
test.log
for more information about the load.
SCOTT@orcl_12.1.0.2.0> select * from oracle_table
2 /
NO NAME ID LOCATION VALUE
---------- ---------- ---------- ---------- ----------
12 simple 3 Singapore gold
34 barate 4 London siler
45 sdfsdfs 5 America diamond
3 rows selected.
|
|
|