Ora-01445: ROWID or sampling cannot be selected from the join view of a table with reserved keywords

Source: Internet
Author: User

Ora-01445: ROWID or sampling cannot be selected from the join view of a table with reserved keywords

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.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.