Some SQL commands commonly used in the Oralce database (add field annotations, modify data, and so on)

Source: Internet
Author: User

Recently began to contact Oralce, organized a few recent SQL commands commonly used in PL

1. Modify the data in the table

write the query statement and condition, and then add "for Update", "for Update" is to get oacle Modify permission, execute this query statement, query the corresponding record

Select *  from  for UPDATE

2. Adding fields and annotations to a table

Alter Table Add VARCHAR2 (a);   -- Add Field  on column  is ' Number of affairs ';   -- Add Comment

3. modifying field data types

Alter Table  Number (ten)

4. Know a field name, reverse lookup table containing this field

as follows, know the field name "Identity_type" and use the following statement to find out which table contains this field

SELECT *  from WHERE = ' Gd_base '  and   like ' identity_type% ';

5. When performing an update operation, if There is no commitat the bottom of the SQL statement, you will need to manually click the "Submit" button after execution

also Note When executing the SQL statement that the data to be updated is exactly the same as the fields that exist in the database

Some SQL commands commonly used in the Oralce database (add field annotations, modify data, and so on)

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.