Modify the field type of existing data in Oracle

Source: Internet
Author: User

Modify the field type of existing data in Oracle [SQL] www.2cto.com create table t_person (id varchar2 (200) primary key, name varchar2 (200), address varchar2 (200 )); [SQL] insert into t_person (id, name, address) values (sys_guid (), 'hangsan', 'beijing'); insert into t_person (id, name, address) values (sys_guid (), 'lisi', 'shangqiu '); change the varchar2 type of address to the clob type (1) [SQL] alter table t_person rename column address to myaddress; change the original field name and address to myaddress (2) [SQL] alter table t_person add address clob; add an original field name address in the table and define the type as the type you want to change. Here is clob (3) [SQL] update t_person set address = myaddress; add the backup myaddress field to the new field address (4) [SQL] alter table t_person drop column myaddress; Delete the backup field myaddress

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.