Home > Database > Oracle > body text

How to write the statement to modify the field name in Oracle

王林
Release: 2020-06-17 10:46:33
Original
3668 people have browsed it

How to write the statement to modify the field name in Oracle

Statement:

alter table tableName rename column oldCName to newCName; -- 修改字段名
Copy after login

Example:

For example, we create a table now:

CREATE TABLE Student(
    id varchar2(32) primary key,
    name varchar2(8) not null,
    age number
  );
Copy after login

Now, we want to modify How to implement the field names of this table?

The statement is as follows:

alter table Student rename name to StuName;
Copy after login

What if you want to modify the data type of the field?

alter table Student modify (id varchar2(64));
Copy after login

Recommended tutorial: oracle tutorial

The above is the detailed content of How to write the statement to modify the field name in Oracle. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!