Solved

Join using external tables

Posted on 2004-08-24
3
741 Views
Last Modified: 2008-02-01
I'm trying to select from three external tables to populate a forth table.
When I run my procedure , I get these error.
What direction do I take to determine the cause of the errors.
*

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-01005: syntax error: found "identifier": expecting one of: "comma, char,
date, defaultif, decimal, double, float, integer, (, nullif, oracle_date,
oracle_number, position, raw, recnum, ), unsigned, varrawc, varchar, varraw,
varcharc, zoned"
KUP-01008: the bad identifier was: ORACLE_SID
KUP-01007: at line 7 column 46
ORA-06512: at "SYS.ORACLE_LOADER", line 14
ORA-06512: at line 1
ORA-06512: at "SA.PROCLOADSTUDENT_2", line 63
ORA-06512: at line 1


The proc:
  BEGIN
  declare    
Cursor tempstudent_cursor is SELECT
 STU_KEY ,
  NAME ,
  STU_ID ,
   BIRTH_DATE ,
   SEX ,
    ETHNIC_SAIL ,
 ETHNIC_DW ,
 TELEPHONE ,
 STREET , STREET2 ,
 CITY , STATE ,
 ZIP_CODE ,
  ENTRY_TERM ,
   ENTRY_ACTION,
    EXIT_TERM ,
 MOST_RECENT_MAJOR ,
 MOST_RECENT_CONC ,
 MOST_RECENT_CAREER ,
 MOST_RECENT_SCHOOL,
 MOST_RECENT_DEPT ,
  MOST_RECENT_SAIL_CLASS ,
MOST_RECENT_DW_CLASS ,
MOST_RECENT_CREDENTIAL ,
 MOST_RECENT_DEGREE_OBJ ,
 ELIGIBLE_TO_REGISTER ,
 BASIS_OF_ADMISSION ,
 EOP ,
 SAS ,
  PRIVACY ,
  EXP_DEGREE_TERM ,
  CREDENTIAL_STATUS ,
CUM_GPA_CSUH ,
 CUM_GPA_HIED ,
 TRANSFER_units ,
  CSUH_ATTEMPTED_units ,
TOTAL_EARNED_units ,
CSUH_EARNED_units ,
 INST_ORIGIN_CODE ,
INST_ORIGIN_NAME
, ZFIRSTNAME,
 ZINIT,
 ZLASTNAME,
 scode.student_code,
 scode.athlete_code,
 semail.personal_email,
   SROW_COUNT
 FROM temp_student temps,
        temp_student_code scode,
        temp_student_email semail
where temps.stu_id = scode.student_id
 AND temps.stu_id = semail.student_id;
 
studentrecord temp_student%rowtype;


begin
execute immediate 'truncate table student';

for studentrecord in tempstudent_cursor
loop

EXIT WHEN tempstudent_cursor%NOTFOUND;

-- the colnames need not be repeated after the insert into and again
--after values if all
-- the columns are being inserted

insert into student
 (STU_KEY ,
  NAME ,
  STU_ID ,
   BIRTH_DATE ,
   SEX ,
   ETHNIC_SAIL ,
   ETHNIC_DW ,
   TELEPHONE ,
   STREET ,
   STREET2 ,
   CITY ,
   STATE ,
   ZIP_CODE ,
   ENTRY_TERM ,
   ENTRY_ACTION,
   EXIT_TERM ,
   MOST_RECENT_MAJOR ,
   MOST_RECENT_CONC ,
   MOST_RECENT_CAREER ,
   MOST_RECENT_SCHOOL,
   MOST_RECENT_DEPT ,
   MOST_RECENT_SAIL_CLASS ,
   MOST_RECENT_DW_CLASS ,
   MOST_RECENT_CREDENTIAL ,
   MOST_RECENT_DEGREE_OBJ ,
   ELIGIBLE_TO_REGISTER ,
   BASIS_OF_ADMISSION ,
   EOP ,
   SAS ,
   PRIVACY ,
   EXP_DEGREE_TERM ,
   CREDENTIAL_STATUS ,
   CUM_GPA_CSUH ,
   CUM_GPA_HIED ,
   TRANSFER_units ,
   CSUH_ATTEMPTED_units ,
   TOTAL_EARNED_units ,
   CSUH_EARNED_units ,
   INST_ORIGIN_CODE ,
   INST_ORIGIN_NAME,
   ZFIRSTNAME,
   ZINIT,
   ZLASTNAME,
   student_codes,
   athlete_code,
   personal_email,
   SROW_COUNT )
  values (

studentrecord.STU_KEY,
studentrecord.NAME,
studentrecord.STU_ID ,
studentrecord.BIRTH_DATE,
 studentrecord.SEX ,
  studentrecord.ETHNIC_SAIL,
studentrecord.ETHNIC_DW,
studentrecord.TELEPHONE,
 studentrecord.STREET,
studentrecord.STREET2,
studentrecord.CITY,
studentrecord.STATE,
studentrecord.ZIP_CODE,
 studentrecord.ENTRY_TERM,
 studentrecord.ENTRY_ACTION,
studentrecord.EXIT_TERM,
 studentrecord.MOST_RECENT_MAJOR,
studentrecord.MOST_RECENT_CONC,
studentrecord.MOST_RECENT_CAREER,
 studentrecord.MOST_RECENT_SCHOOL,
 studentrecord.MOST_RECENT_DEPT,
studentrecord.MOST_RECENT_SAIL_CLASS,
studentrecord.MOST_RECENT_DW_CLASS,
studentrecord.MOST_RECENT_CREDENTIAL,
studentrecord.MOST_RECENT_DEGREE_OBJ,
studentrecord.ELIGIBLE_TO_REGISTER,
 studentrecord.BASIS_OF_ADMISSION,
 studentrecord.EOP,
 studentrecord.SAS,
  studentrecord.PRIVACY,
studentrecord.EXP_DEGREE_TERM,
studentrecord.CREDENTIAL_STATUS,
studentrecord.CUM_GPA_CSUH,
studentrecord.CUM_GPA_HIED,
 studentrecord.TRANSFER_units,
studentrecord.CSUH_ATTEMPTED_units,
 studentrecord.TOTAL_EARNED_units,
studentrecord.CSUH_EARNED_units,
studentrecord.INST_ORIGIN_CODE,
studentrecord.INST_ORIGIN_NAME,
studentrecord.ZFIRSTNAME,
 studentrecord.ZINIT,
studentrecord.ZLASTNAME,
 studentrecord.student_code,
studentrecord.athlete_code,
 studentrecord.personal_email,
studentrecord.SROW_COUNT
);
--noOfRecords := noOfRecords + 1;

end loop;
end;
end procloadstudent_2;

0
Comment
Question by:xoxomos
3 Comments
 
LVL 12

Expert Comment

by:geotiger
ID: 11885045

I think that you are using external table in your procedure and somehow your environment variables are messed up.

Could you let us know your OS and Oracle environment variables? You might be able to find some clues from this thread:

http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:6611962171229

GT
0
 
LVL 23

Accepted Solution

by:
seazodiac earned 250 total points
ID: 11885064
it seems like one of the external table is improperly created.

can you check if the following query can run successfully?

select count(*) from temp_student;

select count(*) from temp_student_code ;
select count(*) from temp_student_email ;
0
 

Author Comment

by:xoxomos
ID: 11885147
The select on the temp_student_code gave the same error.  Thought I had done that query.
Don't go anywhere!
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 RAC 12c 8 87
Can i Import Access Table Into Oracle Using Toad 36 222
Shredding xml into an oracle 11g Database 2 58
Oracle Listener Not Starting 11 52
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ā€¦
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Via a live example, show how to take different types of Oracle backups using RMAN.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

856 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