Oracle cannot delete table or view errors, error code: ora-00942____oracle

Source: Internet
Author: User
At the time of writing hibernate code, a "table or view does not exist" error occurs when you want to save to the Oracle database, but when you enter the database, the table is present and can be edited and analyzed to find that it was created with a "(double quote)". For example, the following is the code that creates the table:

CREATE TABLE "Servicesubscriber" (
' SubscriberId ' VARCHAR2 not NULL,
"Email" VARCHAR (128),
"Realname" VARCHAR2 (50),
"PWD" VARCHAR2 (30),
Constraint Pk_ods_custmr_servicesubscribe primary KEY ("SubscriberId")
)
/

Familiar with the Orcale friend estimated at a glance, the table name and field names above with double quotes, although the table can be successfully built, but cannot save data to the table through hibernate. The solution is to delete the above double quotes when creating the table.

CREATE TABLE Servicesubscriber (
SubscriberId VARCHAR2 (m) not NULL,
Email VARCHAR (128),
Realname VARCHAR2 (50),
PWD VARCHAR2 (30),
Constraint Pk_ods_custmr_servicesubscribe primary KEY (SubscriberId)
)
/

Because I am very unfamiliar with Oracle, the specific reason can only be inferred:

One of the rules for Oracle to create tables is:
You can use uppercase or lowercase letters when you name a table. Oracle is insensitive to capitalization as long as the table name or field name is not enclosed in double quotes. Oracle supports the syntax of using double quotes. However, it is best not to use double quotes directly.

Because the table and column names should be in double quotes when creating the query, and the query generated by hibernate will not have double quotes, an error can occur that cannot find the table or view.

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.