Solved

Join using external tables

Posted on 2004-08-24
3
743 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

696 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