Oracle uses the ALTER action column

Source: Internet
Author: User

Use the ALTER TABLE statement to append, modify, or delete the syntax of a column

1Sql> desctesttable;2Name Type NullableDefaultComments3 -------- ------------ -------- ------- -------- 4EMPNO Number(4) Y5EnameVARCHAR2(Ten) Y6JOBVARCHAR2(9) Y7MGR Number(4) Y8 hiredate DATE Y9SAL Number(7,2) YTenCOMM Number(7,2) Y OneDEPTNO Number(2) Y A  -Sql>--Add Columns -Sql> Alter Tabletesttable the   2  AddPhoto Blob -   3  ; - TableAltered -  +Sql> desctesttable; -Name Type NullableDefaultComments + -------- ------------ -------- ------- --------  AEMPNO Number(4) Y atEnameVARCHAR2(Ten) Y -JOBVARCHAR2(9) Y -MGR Number(4) Y - hiredate DATE Y -SAL Number(7,2) Y -COMM Number(7,2) Y inDEPTNO Number(2) Y - PHOTO BLOB Y to  +Sql>--Modifying column types -Sql> Alter Tabletesttable the   2Modify Deptno Number(3); * TableAltered $ Panax NotoginsengSql> desctesttable; -Name Type NullableDefaultComments the -------- ------------ -------- ------- --------  +EMPNO Number(4) Y AEnameVARCHAR2(Ten) Y theJOBVARCHAR2(9) Y +MGR Number(4) Y - hiredate DATE Y $SAL Number(7,2) Y $COMM Number(7,2) Y -DEPTNO Number(3) Y - PHOTO BLOB Y the  -Sql>--Delete ColumnWuyiSql> Alter Tabletesttable the   2  Drop columnphoto; - TableAltered Wu  -Sql> desctesttable; AboutName Type NullableDefaultComments $ -------- ------------ -------- ------- --------  -EMPNO Number(4) Y -EnameVARCHAR2(Ten) Y -JOBVARCHAR2(9) Y AMGR Number(4) Y + hiredate DATE Y theSAL Number(7,2) Y -COMM Number(7,2) Y $DEPTNO Number(3) Y the  theSql>--Modify column names theSql> Alter Tabletesttable the   2Renamecolumn  -   3Deptno toDNO; in TableAltered the  theSql> desctesttable; AboutName Type NullableDefaultComments the -------- ------------ -------- ------- --------  theEMPNO Number(4) Y theEnameVARCHAR2(Ten) Y +JOBVARCHAR2(9) Y -MGR Number(4) Y the hiredate DATE YBayiSAL Number(7,2) Y theCOMM Number(7,2) Y theDNO Number(3) Y

Oracle uses the ALTER action column

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.