Oracle基本操作,Oracle修改列名,Oracle修改字段类型
oracle基本操作,Oracle修改列名,Oracle修改字段类型
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
©Copyright 蕃薯耀 2017年3月16日
http://www.cnblogs.com/fanshuyao/
- --修改列名
- alter table "KFAPP"."H_USERS" rename column "STATUS" to "new_column"
- --新增列
- alter table h_users
- add (column_name nvarchar2(1) default '1' not null);
- eg:
- alter table h_users
- add (delete_type nvarchar2(1) default '1' not null);
- --删除列
- 1、alter table h_users drop column my_type;
- 2、alter table table_name drop (column_name);
- eg:
- alter table h_users drop (deleteType);
- alter table "H_USERS" drop column "DELETE_TYPE"
- --修改列类型
- alter table tablename modify
- (column_name colomn_type [default value][null/not null]);
- eg:
- alter table h_users modify
- (my_type int default 1);
- -- 查询锁表情况
- select s.SID,s.SERIAL# from v$locked_object a ,dba_objects b ,v$session s
- where a.OBJECT_ID=b.OBJECT_ID and a.SESSION_ID=s.SID
- -- 干掉锁表进程
- alter system kill session '852,28988';
- -- 表H_USERS,自增长字段USER_ID
- -- 创建序列
- create sequence H_USERS_ID_SEQ
- start with 1
- increment by 1
- nomaxvalue
- minvalue 1
- nocycle
- cache 10;
- -- 创建触发器
- create trigger H_USERS_ID_TRG
- before insert on H_USERS for each row
- begin
- select H_USERS_ID_SEQ.nextval into:new.USER_ID from dual;
- end;
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
©Copyright 蕃薯耀 2017年3月16日
http://www.cnblogs.com/fanshuyao/
Oracle基本操作,Oracle修改列名,Oracle修改字段类型的更多相关文章
- 修改SQL数据库中表字段类型时,报“一个或多个对象访问此列”错误的解决方法
在SQL数据库中使用SQL语句(格式:alter table [tablename] alter column [colname] [newDataType])修改某表的字段类型时,报一下错误:由于一 ...
- DataTable数据类型的一些操作 增加行、插入行、修改数据、修改列名、修改列顺序、计算、选取或删除行(列)、排序、某列distinct值 等
Datatable 这个数据类型在C#中涉及到对数据库读取时的用处还是挺大的,最近在处理一个报表开发时,一开始把所有的操作都放在sql 上面来做,就是我需要什么样的数据我就query出什么,但是这样其 ...
- mysql、sqlServer、hsql、oracle、db2各数据库支持的字段类型与最大精度
- django 修改模型中默认字段类型
在ADMIN页面实现一个密码框,模型中是CharField默认类型是textinput,实现方法是在admin.py中重写widgets. 来自为知笔记(Wiz)
- oracle中修改表已有数据的某一列的字段类型的方法,数据备份
1.在开发过程中经常会遇到表中的某一个字段数据类型不对,比如说需要保存的数据带小数,但是在最初设计的时候是给的number(10)类型,开始保存是整数的时候满足要求,后来在保存小数的时候 会发现自动四 ...
- oracle数据库对date字段类型存在空值进行排序的处理方法
oracle数据库对date字段类型存在空值进行排序的处理方法 oracle 数据库,如果表中有一个字段类型为date,且该字段类型存在空值,并且需要排序, 解决方法为使用oracl ...
- 曲演杂坛--使用ALTER TABLE修改字段类型的吐血教训
--===================================================================== 事件起因:开发发现有表插入数据失败,查看后发现INT类型 ...
- Django文档——Model字段类型(Field Types)
大部分内容参考自http://wrongwaycn.github.io/django11/topics/db/models/index.html#topics-db-models ,内容是django ...
- Dynamic Mapping和常见字段类型
原文:Dynamic Mapping和常见字段类型 版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明. 本文链接:https://blog.csdn. ...
随机推荐
- NetBeans Support Weblog
https://blogs.oracle.com/NetBeansSupport/entry/tomcat_log_files ———————————————————————————————————— ...
- vim for python
set encoding=utf8 set paste 编辑模式下的 复制粘贴 set expandtab 貌似是一个 tab 替换成4个空格, 而且当你使用 backspace(删除键), 会自 ...
- Java RMI 的使用及原理
1.示例 三个角色:RMIService.RMIServer.RMIClient.(RMIServer向RMIService注册Stub.RMIService在RMIClient lookup时向其提 ...
- FreeRDP的安装配置(错误信息:SSL_read: Failure in SSL library (protocol error?))
最新文章:Virson's Blog 使用xfreerdp [serveripaddress]命令,连接xp/windows 2003都正常,但是在连接win7/2008时总是出错: ;------- ...
- export Jar from eclipse (总结)
sourceforge 的源码网址 :https://sourceforge.net/projects/fjep/files/fatjar/ <span style="margin:0 ...
- RootKit
类型0:藏在人群中,干扰人工肉眼检查 类型1 2:篡改系统内部的数据结构和调用表,破坏自动化检测工具,这项数据结构和调用表是检测工具和KootKit共用的 类型3:跳出束缚,由rootkit实现本该宿 ...
- Quick solution to java.lang.NoClassDefFoundError: org/openqa/selenium/HasInputDevices error
In case if you face this problem, one of the possible solutions that will work for you is to make su ...
- Java如何在正则表达式中匹配重复单词?
在Java编程中,如何在正则表达式中匹配重复单词? 以下示例显示了如何使用regex.Matcher类的p.matcher()方法和m.group()方法在正则表达式中搜索重复的单词. package ...
- Oracle EM错误,java.lang.Exception: Exception in sending Request :: null 分类: Oracle 2015-07-08 21:24 44人阅读 评论(0) 收藏
操作系统:Win7 64bit Oracle: 10.2.0.1.0 很久没有使用EM了,打开一看,居然报错了,出现java.lang.Exception: Exception in sending ...
- RHEL 7 中 systemctl 的用法(替代service 和 chkconfig)
1.systemctl是RHEL 7 的服务管理工具中主要的工具,它融合之前service和chkconfig的功能于一体.可以使用它永久性或只在当前会话中启用/禁用服务. systemctl可以列出 ...