Solved

Join using external tables

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Migrating an SQL 2008 database to Oracle 12c 3 99
Oracle - Stored Procedure Privilge access 3 53
Schema creation in Oracle12c 6 45
Oracle - Query link database loop 8 37
Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…

813 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

8 Experts available now in Live!

Get 1:1 Help Now