Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Nested table and SQL*Loader
Oracle 8i
I'm having trouble loading data into a nested table with SQL*Loader. I'm trying to follow the examples in the Oracle documentation and several books I have, but they don't seem to work. I keep getting the error message:
SQL*Loader-403: Referenced column not present in table APPLICANT.
I'm not sure whether my tables are wrong, my control file is wrong, or both. I CAN successfully load data into the tables using INSERT statements.
Below is a simplified example of what I am trying to do.
Can anyone out there help?
DROP TABLE Applicant CASCADE CONSTRAINTS; DROP TYPE REFERENCES_NT; CREATE OR REPLACE TYPE REFERENCE_TY AS OBJECT (
Ref_Num NUMBER(1,0), Ref_First_Name VARCHAR2(10), Ref_Last_Name VARCHAR2(10)
CREATE TYPE REFERENCES_NT AS TABLE OF REFERENCE_TY
/
/*----- Definition of "parent" table -----*/
CREATE TABLE Applicant (
Id NUMBER(4,0), First_Name VARCHAR2(10), Last_Name VARCHAR2(10), References REFERENCES_NT,
/*----- Definition of sequence for Id number -----*/
DROP sequence AppID_seq;
CREATE sequence AppID_seq INCREMENT BY 1 START WITH 1 NOCACHE;
COMMIT;
/*----- Mass-load values -----*/
host sqlldr userid=scott/tiger control='example.ctl'
Id "AppID_seq.nextval", First_Name position(01:04) CHAR, Last_Name position(06:15) CHAR, References NESTED TABLE COUNT(1) ( References COLUMN OBJECT ( Ref_Num POSITION(28:28) INTEGER EXTERNAL(1), Ref_First_Name position(30:39) CHAR, Ref_Last_Name position(41:50) CHAR ) ) )
0002 John Doe 1 Guy Madison 2 Elliot Ness 0003 Richard Lionheart 1 Robin Hood 2 Saladin 0004 Francis Drake 1 Elizabeth Tudor 2 GuyFawkes
Thanks.
John Giguette
Received on Wed Mar 14 2001 - 10:07:43 CST
![]() |
![]() |