Solved

External table problem

Posted on 2004-08-10
3
1,594 Views
Last Modified: 2008-01-09
I created this external table, then tried a query for count.
What have I done wrong and how do I fix it?


SQL> @test2.sql

Table created.

SQL> select count(*) from temp_student;
select count(*) from temp_student
*
ERROR at line 1:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-00554: error encountered while parsing input commands
KUP-01006: error signalled during parse
KUP-00562: unknown escape sequence
ORA-06512: at "SYS.ORACLE_LOADER", line 14
ORA-06512: at line 1


SQL> desc temp_student;
 Name                                      Null?    Type
 ----------------------------------------- -------- ---------------

 STU_KEY                                            NUMBER(10)
 NAME                                               VARCHAR2(32)
 STU_ID                                             CHAR(9)
 BIRTH_DATE                                         DATE
 SEX                                                CHAR(1)
.
.
.
.


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 Comments
 
LVL 5

Expert Comment

by:gmyers
ID: 11769804
Generally, you would have been better off posting the contents of your test2.sql script. It's hard to see the problem in a script you haven't shown.
Fortunately, in this case the error code has a note on metalink.

From Metalink :

    * symptom: SELECT from an EXTERNAL TABLE fails
    * symptom: ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    * symptom: ORA-29400: data cartridge error
    * symptom: KUP-00554: error encountered while parsing access parameters
    * symptom: KUP-01006: error signalled during parse of access parameters
    * symptom: KUP-00562: unknown escape sequence
    * symptom: ORA-06512: at "SYS.ORACLE_LOADER", line 14
    * symptom: ORA-06512: at line 1
    * cause: The location of the badfile or logfile or discardfile contains the full path and therefore the \ character, considered as an escape character.

fix:

Do not enter in the ACCESS PARAMETERS clause, the full path of the file names
in the CREATE TABLE ORGANIZATION EXTERNAL statement.
0
 

Author Comment

by:xoxomos
ID: 11775697
CREATE TABLE temp_student
 (
   STU_KEY NUMBER(10) ,
   NAME   VARCHAR2(32 ),
   STU_ID CHAR(9 ),
   BIRTH_DATE DATE,
   SEX CHAR(1 )  
  )  
  ORGANIZATION EXTERNAL
     (TYPE oracle_loader
      DEFAULT DIRECTORY student_database
      ACCESS PARAMETERS
       (
        RECORDS DELIMITED BY newline
        BADFILE 'd:\oracle\migration\student_bad.txt'
        DISCARDFILE 'd:\oracle\migration\student_discard.txt'
        LOGFILE 'd:\oracle\migration\student_log.txt'
       )
   LOCATION ('d:\oracle\student_database\dwstubio')  
     );
0
 
LVL 6

Accepted Solution

by:
morphman earned 250 total points
ID: 11778942
You are missing the actual access parameters for the fields (ie which position they are. See your other thread asking a similar question to which I have answered with an example of how the above query should work).
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to drop system generated virtual column in a table in12c 15 177
subtr returning incorrect value 8 89
format dd/mm/yyyy parameter 16 56
UTL_FILE invalid file operation 5 55
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that useā€¦
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

742 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