alter table语法

2024-06-04 17:08
文章标签 语法 table alter

本文主要是介绍alter table语法,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

文档地址:http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_3001.htm#CIHCFDDJ

 

ALTER TABLE

Purpose

Use the ALTER TABLE statement to alterthe definition of a nonpartitioned table, a partitioned table, atable partition, or a table subpartition. For object tables orrelational tables with object columns, use ALTERTABLE to convert the table to the latest definition ofits referenced type after the type has been altered.

 

 

add_column_clause::=

Description of add_column_clause.gif follows
Description of the illustrationadd_column_clause.gif

(column_definition::=,column_properties::=)

column_definition::=

Description of column_definition.gif follows

column_definition

Unless otherwise noted in this section, the elements ofcolumn_definition have the samebehavior when adding a column to an existing table as they do whencreating a new table. Please refer to column_definition for information.

Restriction on column_definition TheSORT parameter is valid only when creating a newtable. You cannot specify SORT in thecolumn_definition of an ALTER TABLE ...ADD statement.

If you add a column, then the initial value of each row for thenew column is null unless you specify the DEFAULTclause. In this case, Oracle Database updates each row in the newcolumn with the value you specify for DEFAULT. Thisupdate operation, in turn, fires any AFTERUPDATE triggers defined on the table.

Note:

If a column has a default value, then you can use the DEFAULT clause to change the default to NULL, but you cannot remove the default valuecompletely. That is, if a column has ever had a default valueassigned to it, then the DATA_DEFAULT column of the USER_TAB_COLUMNS data dictionary view will alwaysdisplay either a default value or NULL.

You can add an overflow data segment to each partition of apartitioned index-organized table.

You can add LOB columns to nonpartitioned and partitionedtables. You can specify LOB storage at the table and at thepartition or subpartition level.

If you previously created a view with a query that used theSELECT * syntax to select all columnsfrom table, and you now add a column to table, then the database doesnot automatically add the new column to the view. To add the newcolumn to the view, re-create the view using theCREATE VIEW statement with theOR REPLACE clause. Please refer toCREATE VIEW for more information.

 

这篇关于alter table语法的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!


原文地址:
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.chinasem.cn/article/1030608

相关文章

MySQL的ALTER TABLE命令的使用解读

《MySQL的ALTERTABLE命令的使用解读》:本文主要介绍MySQL的ALTERTABLE命令的使用,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录1、查看所建表的编China编程码格式2、修改表的编码格式3、修改列队数据类型4、添加列5、修改列的位置5.1、把列

mysql递归查询语法WITH RECURSIVE的使用

《mysql递归查询语法WITHRECURSIVE的使用》本文主要介绍了mysql递归查询语法WITHRECURSIVE的使用,WITHRECURSIVE用于执行递归查询,特别适合处理层级结构或递归... 目录基本语法结构:关键部分解析:递归查询的工作流程:示例:员工与经理的层级关系解释:示例:树形结构的数

Java使用Stream流的Lambda语法进行List转Map的操作方式

《Java使用Stream流的Lambda语法进行List转Map的操作方式》:本文主要介绍Java使用Stream流的Lambda语法进行List转Map的操作方式,具有很好的参考价值,希望对大... 目录背景Stream流的Lambda语法应用实例1、定义要操作的UserDto2、ListChina编程转成M

Pandas透视表(Pivot Table)的具体使用

《Pandas透视表(PivotTable)的具体使用》透视表用于在数据分析和处理过程中进行数据重塑和汇总,本文就来介绍一下Pandas透视表(PivotTable)的具体使用,感兴趣的可以了解一下... 目录前言什么是透视表?使用步骤1. 引入必要的库2. 读取数据3. 创建透视表4. 查看透视表总结前言

Python正则表达式语法及re模块中的常用函数详解

《Python正则表达式语法及re模块中的常用函数详解》这篇文章主要给大家介绍了关于Python正则表达式语法及re模块中常用函数的相关资料,正则表达式是一种强大的字符串处理工具,可以用于匹配、切分、... 目录概念、作用和步骤语法re模块中的常用函数总结 概念、作用和步骤概念: 本身也是一个字符串,其中

Mysql用户授权(GRANT)语法及示例解读

《Mysql用户授权(GRANT)语法及示例解读》:本文主要介绍Mysql用户授权(GRANT)语法及示例,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录mysql用户授权(GRANT)语法授予用户权限语法GRANT语句中的<权限类型>的使用WITH GRANT

HTML5表格语法格式详解

《HTML5表格语法格式详解》在HTML语法中,表格主要通过table、tr和td3个标签构成,本文通过实例代码讲解HTML5表格语法格式,感兴趣的朋友一起看看吧... 目录一、表格1.表格语法格式2.表格属性 3.例子二、不规则表格1.跨行2.跨列3.例子一、表格在html语法中,表格主要通过< tab

Java使用ANTLR4对Lua脚本语法校验详解

《Java使用ANTLR4对Lua脚本语法校验详解》ANTLR是一个强大的解析器生成器,用于读取、处理、执行或翻译结构化文本或二进制文件,下面就跟随小编一起看看Java如何使用ANTLR4对Lua脚本... 目录什么是ANTLR?第一个例子ANTLR4 的工作流程Lua脚本语法校验准备一个Lua Gramm

Java字符串操作技巧之语法、示例与应用场景分析

《Java字符串操作技巧之语法、示例与应用场景分析》在Java算法题和日常开发中,字符串处理是必备的核心技能,本文全面梳理Java中字符串的常用操作语法,结合代码示例、应用场景和避坑指南,可快速掌握字... 目录引言1. 基础操作1.1 创建字符串1.2 获取长度1.3 访问字符2. 字符串处理2.1 子字

Python基础语法中defaultdict的使用小结

《Python基础语法中defaultdict的使用小结》Python的defaultdict是collections模块中提供的一种特殊的字典类型,它与普通的字典(dict)有着相似的功能,本文主要... 目录示例1示例2python的defaultdict是collections模块中提供的一种特殊的字