• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1633
  • Last Modified:

External table problem

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
xoxomos
Asked:
xoxomos
1 Solution
 
gmyersCommented:
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
 
xoxomosAuthor Commented:
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
 
morphmanCommented:
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now