Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Join using external tables

Posted on 2004-08-24
3
Medium Priority
?
751 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 1000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
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.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
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
Suggested Courses

824 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