Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Input file for organization external table, without NEWLINE

anand_gpMay 20 2017 — edited May 20 2017

Hi,

I am trying to read an external text file with organization external table. However, my select query fails reading the file properly.

I use below create table -

create table TAB1 ( field_1 CHAR(10),field_2 CHAR(10) )

organization external (

type oracle_loader

default directory ABC_DL_DIR

access parameters (

 records delimited by newline

 fields (  field\_1 position(1: 4) char(10),

           field\_2 position(5:10) char(10) )   )

location ('0050-pcrx.txt.txt')

)

reject limit unlimited;

What I observe that, if I look at the file from Notepad++, the input file looks good with records showing in different line. However, if I open same file from Notepad, everything shows in single line. Can you please let me know how to deal with such input files. Since this file comes directly from a device, I don't have option to manipulate the file.

File seen from Notepad++ -

pastedImage_1.png

Same file seen from Notepad -

pastedImage_2.png

Select query error -

SQL> select * from DD;

select * from DD

*

ERROR at line 1:

ORA-29913: error in executing ODCIEXTTABLEFETCH callout

ORA-29400: data cartridge error

KUP-04018: partial record at end of file C:\TEMP\DATALOAD\0050-pcrx.txt.txt

Thanks & Regards,

-Anand

This post has been answered by Paulzip on May 20 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 17 2017
Added on May 20 2017
8 comments
571 views