ora-01445: Cannot select rowID or sampling from the connection view of a table with reserved keywords

Source: Internet
Author: User

Today, when querying a view, the query has a ROWID field, which results in an error:

Two simple table tests were made: Student,class

1. Create a table

CREATE TABLE STUDENT
(
Sno Number,
Sname VARCHAR2 (32)
)

-----------------------------------

CREATE TABLE CLASS
(
CNO number is not NULL,
Sno number is not NULL,
CNAME VARCHAR2 (32)
)

2. Create a View

Create or replace view Stu_class_v as
Select S.sno, S.sname, C.cno, C.cname

From student S, Stu_class c
where S.sno = C.sno

3. Query the View

Select rowID, sno from Stu_class_v

You will be quoted as a mistake.

Because the two new tables, the main table and the table are not set the corresponding primary key, here the student table to add the primary key, and then query the view, query normal

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

ora-01445: Cannot select rowID or sampling from the connection view of a table with reserved keywords

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.