?
Solved

SQLLDR question

Posted on 2004-08-11
8
Medium Priority
?
2,950 Views
Last Modified: 2012-06-22
I have a flat file with fixed length fields where there is no character that terminates the field.
I'm trying to set up an external table and it wants a 'field terminated by'.
What can I use here?
0
Comment
Question by:xoxomos
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 15

Expert Comment

by:jdlambert1
ID: 11777488
There's no visible printable character, but there's either a terminator or one long run-on line.
Most likely either CHR(10) for line-feed, CHR(13) for carriage-return.
0
 

Author Comment

by:xoxomos
ID: 11777556
I believe that would be more for the record(row) I'm looking more for the field(column).
0
 
LVL 15

Expert Comment

by:jdlambert1
ID: 11777596
Sorry about that. How are you currently doing it? (Which tool is giving you the error message)
0
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

 

Author Comment

by:xoxomos
ID: 11777914
Right now I'm not doing it.  I left the field delimited by out so it thinks everything is 255.



Field Definitions for table TEMP_STUDENT
  Record format DELIMITED BY NEWLINE
  Data in file has same endianness as the platform

  Fields in Data Source:

    STU_KEY                         CHAR (255)
      Terminated by ","
      Trim whitespace same as SQL Loader
    NAME                            CHAR (255)
      Terminated by ","
      Trim whitespace same as SQL Loader
    STU_ID                          CHAR (255)
      Terminated by ","
      Trim whitespace same as SQL Loader
    BIRTH_DATE                      CHAR (255)
      Terminated by ","
      Trim whitespace same as SQL Loader
    SEX                             CHAR (255)
      Terminated by ","
      Trim whitespace same as SQL Loader
KUP-04076: file name cannot contain a path specification: d:\oracle\student_database\dwstubio
0
 

Author Comment

by:xoxomos
ID: 11778073
With sqlldr, i can use
INTO TABLE student
(
STU_KEY                    POSITION(1:10) CHAR,
NAME                       POSITION(11:42) CHAR,
STU_ID                     POSITION(43:51) CHAR,
BIRTH_DATE                 POSITION(52:59) DATE "YYYYMMDD",
SEX                        POSITION(60:60) CHAR,
and not supply field terminated by.  Trying to use external table , i don't see what the option is.
0
 
LVL 6

Accepted Solution

by:
morphman earned 1000 total points
ID: 11778914
Here is an example of hwo to do it with fixed length fields:-

create table ext_table (
   field_1 char(4),
   field_2 char(30)
 )
 organization external (
   type       oracle_loader
   default directory ext_dir
   access parameters (
     records delimited by newline
     fields (
      field_1 position(1:4) char(4),
      field_2 position(5:30) char(30)
     )
   )
   location ('file')
 )
 reject limit unlimited;

All the best,
Dan
0
 
LVL 14

Expert Comment

by:leoahmad
ID: 11779250
goto http://www.softtreetech.com and download DB Tools for Oracle - and this can easily upload text files using File Loader.

LeoAhmad
0
 
LVL 14

Expert Comment

by:leoahmad
ID: 11779262
another option do it manually:

 create directory md as 'e:\q'
SQL> /

Directory created.

SQL> create table mytab(a number,b number, c varchar2(2000))
  2  Organization external
  3  (type oracle_loader
  4  default directory md
  5  access parameters
  6  (fields terminated by '')
  7  location ('1.txt')
  8  )
  9  /

Table created.

SQL> select * from mytab;
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question