Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: How do I change the interpreted decimal character in an external table file
Hi Jaap,
Sorry for the sluggish reply - busy day at work.
For the following data file :-
1|111.111,0
2|456.123,5
I thought you might be able to do something like this, which is valid sqlldr syntax :-
LOAD DATA
INFILE 'test.txt'
TRUNCATE
INTO TABLE doug_test
FIELDS TERMINATED BY "|"
(pk, test_value CHAR "TO_NUMBER(:test_value, '999,990.90', 'NLS_NUMERIC_CHARACTERS = '',.''')"
However, it's not valid external table syntax as far as I can tell. The following works fine until I add the TO_NUMBER string :-
SQL> CREATE TABLE doug_test
2 (
3 "PK" NUMBER,
4 "TEST_VALUE" VARCHAR(255)
5 )
6 ORGANIZATION external
7 (
8 TYPE oracle_loader
9 DEFAULT DIRECTORY test_dir
10 ACCESS PARAMETERS
11 (
12 RECORDS DELIMITED BY NEWLINE CHARACTERSET WE8MSWIN1252 13 READSIZE 1048576 14 FIELDS TERMINATED BY "|" LDRTRIM 15 REJECT ROWS WITH ALL NULL FIELDS 16 ( 17 "PK" CHAR(255) 18 TERMINATED BY "|", 19 "TEST_VALUE" CHAR(255) 20 TERMINATED BY "|"
SQL> select * from doug_test;
select * from doug_test
*
ERROR at line 1:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout ORA-29400: data cartridge error KUP-00554: error encountered while parsing access parameters KUP-01005: syntax error: found "double-quoted-string": expecting oneof:
"comma, date_format, defaultif, enclosed, ltrim, lrtrim, ldrtrim, notrim, nullif, optionally, ), rtrim" KUP-01007: at line 10 column 3
Still thinking about it, though!
Cheers,
-- Doug Burns - Oracle DBA dougburns_at_yahoo.com http://doug.burns.tripod.com http://oracledoug.blogspot.comReceived on Wed Aug 31 2005 - 17:00:52 CDT
![]() |
![]() |