Solved

Join using external tables

Posted on 2004-08-24
3
737 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
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…
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

867 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

18 Experts available now in Live!

Get 1:1 Help Now