Home > Database > Mysql Tutorial > body text

oracle alter语句用法

WBOY
Release: 2016-06-07 17:45:52
Original
1524 people have browsed it

oracle alter语句用法

sql>
sql> create table bar ( n number );

table created.

sql>
sql> alter table bar add c char(1);

table altered.

sql>
sql> drop table bar;

table dropped.

sql>

  
增加一个日期字段

sql>
sql> create table bar ( n number );

table created.

sql>
sql>  alter table bar add d date;

table altered.

sql>
sql>  object_type, status
  2      from user_objects
  3     where object_name = 'shield'
  4    /

object_type         status
------------------- -------
package             valid
package body        valid

sql>
sql> drop table bar;

table dropped.

sql>

给己有表的增加字段

sql> -- create demo table
sql> create table employee(
  2    id                 varchar2(4 byte)         not null,
  3    first_name         varchar2(10 byte),
  4    last_name          varchar2(10 byte),
  5    start_date         date,
  6    end_date           date,
  7    salary             number(8,2),
  8    city               varchar2(10 byte),
  9    description        varchar2(15 byte)
 10  )
 11  /

table created.

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