DB2 Defining table fields

Source: Internet
Author: User
Tags db2

>[Error] Script line: 1-1---------------------------------------

"STATUS" is not valid in the context where it is used. sqlcode=-206, sqlstate=42703, driver=3.53.71

More exceptions ... An error occurred during implicit system action type "2". Information returned for the error includes SQLCODE " -206", SQLSTATE "42703" and Message Tokens "STATUS": sqlcode=-727, sqlstate=56098, driver=3.53.71

This error is always reported when executing the SQL text because:

In DB2, all names can contain characters by default: A-Z (uppercase) 0 to 9 @, #, $, and _ (underscore) names cannot begin with numbers and underscores.

A table of database objects whose names follow the above rules, so even if you use the command to create a table with lowercase, DB2 will still convert it to uppercase.

However, it is important to note that not the DB client software will be automatically converted, I am using the IBM Data Studio4 or Aqua Data studio and other clients, I found that statistics studio provided by the graphical interface created, not automatically converted to uppercase,

For example, when you create a table using studio, you define the field as a lowercase status, and then use normal SQL statement operations, such as:

SELECT * from Large_receipt where status= ' E ' will error

WORKAROUND: Use uppercase letters when defining

DB2 Defining table fields

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.