Table Design avoid using Reserved Words

Source: Internet
Author: User

Table Design avoids the use of reserved Words in the v $ reserved_words record keywords and reserved words. The reserved field content is Y, indicating that the reserved word is used in the identifier. If the reserved keyword is N, it may also trigger Oracle bugs, so avoiding the use is the best choice. Here is an experiment. An error will be reported during creation. To create a project successfully, double quotation marks must be added.

SQL> select * from v $ reserved_words wherekeyword = 'SIZE '; keyword length reserved RES_TYPE RES_ATTR RES_SEMI DUPLICATE -------- ------------------ -------- ---------- SIZE 4 y n nsql> createtable test (id number, size number); create tabletest (id number, size number) * row 1st error: ORA-00904: identifier invalid SQL> createtable test (id number, "size" number); table created. SQL> insertinto test values (); 1 row has been created. SQL> commit; submitted completely. SQL> select * from test; ID size ------------------ 1 1SQL> selectsize from test; select size fromtest * row 1st error: ORA-00936: Missing expression SQL> select "size" from test; size ---------- 1

 


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.