Skip to content

DBAzine.com

Sections
Personal tools
You are here: Home » Oracle » Oracle Articles Archive » External Tables in Oracle9i » Need Help
Seeking new owner for this high-traffic DBAzine.com site.
Tap into the potential of this DBA community to expand your business! Interested? Contact us today.
Who Are You?
I am a:
Mainframe True Believer
Distributed Fast-tracker

[ Results | Polls ]
Votes : 3553
 

Comment

Above in this comment thread: External Tables in Oracle9i

Need Help

Posted by Ravgopal at 2006-10-17 05:11 PM
Hi
I need an help. I am trying to load external table from a DAT file. The file and table contains only one number field.

The data is just pure numbers like
2374
2375
2376
2377
2378

When I try to query the external table I am getting the following error

LOG file opened at 10/17/06 16:52:22

Field Definitions for table DBKEY_EXTERNAL
Record format DELIMITED BY NEWLINE
Data in file has same endianness as the platform
Rows with all null fields are accepted

Fields in Data Source:

DBKEY CHAR (255)
Terminated by ","
Trim whitespace same as SQL Loader
error processing column DBKEY in row 1 for datafile /landingpad/ndt2stage/MMADHOC_DBKEYS.DAT
ORA-01722: invalid number

The table definition is :

create table DBKEY_EXTERNAL
( DBKey number
)
organization external
(type oracle_loader default directory NDT2STAGE
access parameters
( records delimited by newline
fields terminated by ','
)
location ('MMADHOC_DBKEYS.DAT')
)
REJECT LIMIT UNLIMITED;

Why does the loader reads the number as Char(255)? The table is having number data type, when I query the table I am getting this error. I would appreciate any help.

Thanks
RG

Ignore the previous error

Posted by Ravgopal at 2006-10-17 06:40 PM
Please ignore the previous error. I found the issue. The data was having new line character at the end. I cleaned the data and tried it worked fine.

Thanks
Rg
 
Transaction Management
Reduce downtime and increase repeat sales by improving end-user experience.
Free White Paper
Database Recovery
Feeling the increased demands on data protection and storage requirements?
Download Free Report!
 
 

Powered by Plone