Ora-01445: unable to select ROWID or sampling from the join view of a table without reserved keywords, ora-01445rowid
When you query a view today, the query contains the rowid field, and an error is returned:
Two simple table tests: STUDENT and CLASS
1. Create a table
Create table STUDENT
(
Sno NUMBER,
Sname VARCHAR2 (32)
)
-----------------------------------
Create table CLASS
(
Cno NUMBER not null,
Sno NUMBER not null,
Cname VARCHAR2 (32)
)
2. Create a view
Create or replace view stu_class_v
Select s. sno, s. sname, c. cno, c. cname
From student s, stu_class c
Where s. sno = c. sno
3. View query
Select rowid, sno From stu_class_v
The above error is reported.
Because no primary key is set for the master and slave tables of the newly created two tables, the STUDENT table is added with a primary key and the view is queried. The query is normal.
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.