Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL*LOADER CTL question

Status
Not open for further replies.

babsjoy

Programmer
Sep 1, 2003
46
0
0
US
How do I stop rounding in the below CTL for the TOTAL_AMOUNT field? Tried using ZONED DECIMAL but that did not work. Tried using no datatype (as shown below) and that did not work. Fields coming in (used in adding)are loading into the table correctly. In the database table the field is defined as NUMBER(10,2). Could it be the position of the field within the table?


LOAD DATA
INFILE '\\drive\folder\Labor.dat'
INTO TABLE LABDET
( JOB_ORDER POSITION(04:10) CHAR,
EXP_ELEMENT POSITION(16:19) CHAR,
COST_ELEMENT_CD POSITION(20:21) CHAR,
SSN POSITION(27:36) CHAR,
EMP_NAME POSITION(37:56) CHAR,
PCC POSITION(59:63) CHAR,
BCC POSITION(66:70) CHAR,
TOTAL_HOURS POSITION(87:91) ZONED (5,2),
TOTAL_AMOUNT ":)ACCEL_AMT+:IND_OVHD_AMT+:GEN_OVHD_AMT)",
ACCEL_AMT POSITION(100:107) ZONED (8,2),
IND_OVHD_AMT POSITION(108:113) ZONED (6,2),
GEN_OVHD_AMT POSITION(114:119) ZONED (6,2),
DATE_WORKED POSITION(141:146) CHAR,
PAY_PER_NUMBER POSITION(172:173) CHAR,
ADD_DATE SYSDATE,
RECORD_ID POSITION(151:158) CHAR )
 
Hi,

not a solution but a workaround:
Why do you need to populate field TOTAL_AMOUNT on import?
You might as well compute and update afterwards.

And why do you need column TOTAL_AMOUNT at all?
Using a column that could easily be computed from other columns is considered bad practice, as it has a good chance of resulting in inconsistencies.

regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top