Home > Database > Oracle > body text

How to add fields to a table in Oracle

WBOY
Release: 2022-01-06 15:06:19
Original
113700 people have browsed it

In Oracle, you can use the "alter table add" statement to add fields to the table. The added fields can only be placed behind the existing fields and cannot be inserted between existing fields. The syntax is "Alter Table Table name Add field name field type".

How to add fields to a table in Oracle

The operating environment of this tutorial: Windows 10 system, Oracle 11g version, Dell G3 computer.

How to add fields in oracle table

Use sql statement to add

1. Add a field: (Add field When, it can only be arranged after existing fields and cannot be inserted between existing fields)

Alter   Table    t_si_addr    Add    CHG_ADDR_FLAG   number(1,0);
Copy after login

Alter Table Table name Add field name Field type;

2. Add two fields ;

Alter Table t_si_addr Add (CHG_ADDR_FLAG number(1,0),ADD_BY_IOM Varchar2(2));
Copy after login

Alter Table table name Add (field name field type, field name field type);

Examples are as follows:
How to add fields to a table in Oracle

Recommended tutorial: " Oracle Tutorial

The above is the detailed content of How to add fields to a table 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