Home » RDBMS Server » Server Utilities » sql*loader (oracle10g)
sql*loader [message #487022] Wed, 22 December 2010 01:18 Go to next message
zodiacsom
Messages: 37
Registered: December 2009
Location: pune
Member
i have source file contain only one value ,how i can define
position in control file

if say that file start at 6 and at 7 filler ($) and then rest of
data.
So i want only value at 6th position

in ctl file


application_code position(6) char(1)


show error ..

how should i difine position in ctl ... please help
Re: sql*loader [message #487025 is a reply to message #487022] Wed, 22 December 2010 01:21 Go to previous messageGo to next message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I have difficulties understanding what you have. Could you post table description and a few lines of the source file? What column should contain that value?
Re: sql*loader [message #487030 is a reply to message #487025] Wed, 22 December 2010 01:25 Go to previous messageGo to next message
zodiacsom
Messages: 37
Registered: December 2009
Location: pune
Member
sure ..

source file
10$somnath$d$2004-12-2
20$rajiv  $c$2004-12-5

ctl file

i need only d and c in my table test.
starting at positon 12

please tell me how to wirte in control file to get only d/c

table test ( creadit varchar2(1));


[EDITED by LF: applied [pre] tags]

[Updated on: Wed, 22 December 2010 04:54] by Moderator

Report message to a moderator

Re: sql*loader [message #487056 is a reply to message #487030] Wed, 22 December 2010 04:57 Go to previous message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Control file:
LOAD DATA 
INFILE *
REPLACE
INTO TABLE test
FIELDS TERMINATED BY "$"
  (credit position(12:12))

BEGINDATA
10$somnath$d$2004-12-2
20$rajiv  $c$2004-12-5

Loading session and the result:
SQL> $sqlldr scott/tiger@ora10 control=test.ctl log=test.log

SQL*Loader: Release 10.2.0.1.0 - Production on Sri Pro 22 11:56:20 2010

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Commit point reached - logical record count 1
Commit point reached - logical record count 2

SQL> select * from test;

C
-
d
c

SQL>
Previous Topic: ORA-12899 in import
Next Topic: Export Hangs at 'exporting cluster definitions'
Goto Forum:
  


Current Time: Fri Apr 19 09:31:01 CDT 2024