Re: help!ORA-01445: cannot select ROWID from a join view without a key-preserved table

From: kaapie <elliott_craig_at_hotmail.com>
Date: 12 Jul 2004 20:55:28 -0700
Message-ID: <ccvmfg$2fl_at_odah37.prod.google.com>



Oracle does not know which table's rowid to return from this view and thus it gives an error.

What this means is that one of the underlying tables in the view has to have either a primary key or a unique index that will ensure the result is unique.
The result of the query does not have to contain the key of the table but must act as though the key was used. http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96590/adg03sch.htm#1044

TODO: check your schema to make sure that there is a primary key or unique index on your table that has only unique records.

tracy wrote:
> when i run the statement:
> SQL> select rowid from student_semester;
> ERROR at line 1:
> ORA-01445: cannot select ROWID from a join view without a
> key-preserved table
>
> student_semester is a view with the sql :
> CREATE OR REPLACE VIEW "ICEM_USER"."STUDENT_SEMESTER" ("STUD_ID",
> "SEMESTER_STATUS_ID","SEMESTER_STATUS_YEAR",
> "SEMESTER_STATUS_SEMESTER","SEMESTER_STATUS_PROGRAM",
> "SEMESTER_STATUS_BRANCH","SEMESTER_STATUS_DESC") AS
> select
> STUD_ID ,
> SEMESTER_STATUS_ID ,
> SEMESTER_STATUS_YEAR ,
> SEMESTER_STATUS_SEMESTER ,
> SEMESTER_STATUS_PROGRAM ,
> SEMESTER_STATUS_BRANCH ,
> SEMESTER_STATUS_DESC
> from student_profile, semester_status
> where stud_program = SEMESTER_STATUS_PROGRAM
>
>
> Now, my users can't run query from a forms, which contains this
> tables. Before yesterday, they able to do this.
>
> Pls tell me what;s wrong and how to fix it.
>
>
> TQ!
>
> regards,
> Tracy
Received on Tue Jul 13 2004 - 05:55:28 CEST

Original text of this message