![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I am having an issue while inserting data into an oracle table through sqlldr. My requirement is to be able to enter data into a field with 4 decimal places. Since I am getting data which has values with more than 4 decimal places those records are rejected. I use the following command in the control file for the table: LOAD DATA * *APPEND * *INTO TABLE TB_01 * * * * WHEN record_type_CD = 'RECORD' * * * * FIELDS TERMINATED BY "|" * * * * trailing NULLCOLS ( * * * *COLUMN_1 * * * * INTEGER * * * * EXTERNAL, * * * *COLUMN_2 * * * * CHAR * * * * * * * * "TO_NUMBER(:COLUMN_2,'999999999.9999')", * * * *COLUMN_3 * * * *INTEGER * * * * *EXTERNAL ) The records get rejected when the data for column 2 is like "| 80300.3519999999989522621035575866699219|" If I change the control file and make the code for column 2 as COLUMN_2 * * * * CHAR * * * * * "TO_CHAR(:COLUMN_2,'999999999D9999')" then the load rejects records with data like "|4257000000|" in column 2. I want to be able to insert both the records into the table with the value being limited to 4 decimal places. Let me know if you can provide any help on this. Any help would be appreciated. Thanks! |
#3
| |||
| |||
|
|
On 14 Sep, 14:56, Sandy80 <svarshneym... (AT) gmail (DOT) com> wrote: Hi, I am having an issue while inserting data into an oracle table through sqlldr. My requirement is to be able to enter data into a field with 4 decimal places. Since I am getting data which has values with more than 4 decimal places those records are rejected. I use the following command in the control file for the table: LOAD DATA * *APPEND * *INTO TABLE TB_01 * * * * WHEN record_type_CD = 'RECORD' * * * * FIELDS TERMINATED BY "|" * * * * trailing NULLCOLS ( * * * *COLUMN_1 * * * * INTEGER * * * * EXTERNAL, * * * *COLUMN_2 * * * * CHAR * * * * * * * * "TO_NUMBER(:COLUMN_2,'999999999.9999')", * * * *COLUMN_3 * * * *INTEGER * * * * *EXTERNAL ) The records get rejected when the data for column 2 is like "| 80300.3519999999989522621035575866699219|" If I change the control file and make the code for column 2 as COLUMN_2 * * * * CHAR * * * * * "TO_CHAR(:COLUMN_2,'999999999D9999')" then the load rejects records with data like "|4257000000|" in column 2. I want to be able to insert both the records into the table with the value being limited to 4 decimal places. Let me know if you can provide any help on this. Any help would be appreciated. Thanks! Have you tried the TRUNC function? HTH -g- Hide quoted text - - Show quoted text - |
#4
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |