Solved

SQLLDR question

Posted on 2004-08-11
8
2,929 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
  • 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
 

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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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 250 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
oracle query help 36 83
VB.Net - CSV to Oracle table 4 52
automatic email alert 1 42
oracle 11g 23 50
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 …
Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
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

920 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now