Oracle naming rules

Source: Internet
Author: User

Naming of various data objects in Oracle, including table names, views, and so on, must follow the naming rules of oracle. Oracle naming rules are classified into standard naming and non-standard naming.

The standard naming method must meet the following conditions:

  1. Start with a character
  2. 30 characters or less
  3. Can only contain A-Z, A-Z, 0-9, _, $, and, $ and #
  4. It cannot be the same as other objects under the same user.
  5. It cannot be a reserved word of the Oracle server

For example, the following SQL statement is incorrect: Create tabel emp-Bonus (empid number (10), bonus number (10); because the table name uses "-", this is not allowed in standard naming.

Another type is non-standard naming. At this time, you can use any character you want to use, including Chinese characters, reserved words in Oracle, spaces, and so on. However, the object name must be enclosed in double quotation marks. For example, create table "table" (test1 varchar2 (10); a table named table is created. There are no syntax errors. However, in this case, the object must be enclosed in double quotation marks later. For example, you cannot use select * from table for the created table, only select * from "table" can be used ";

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.