![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Oracle
tanlingcau
这个作者很懒,什么都没留下…
展开
-
oracle 删除列
alter table tableName drop column cloumnName;2010-03-11 16:41:33 · 381 阅读 · 0 评论 -
plsql:导入excel数据(手动快速方式)
1,打开PL/SQL Developer的sql window窗口;2,输入select * from tablename for update;3,按F8执行;4,把表内容置为全选状态,然后粘贴excel数据;5,commit提交。 注意:excel中的第一列可能为自动增长列,可将第一列复制,然后插入列前面,然后再全选粘贴。...原创 2010-09-16 10:39:22 · 1154 阅读 · 0 评论 -
Oracle 已有表增加非空列
alter table table_name add(col type);update table_name set col = 'value';alter table table_name modify(col (type) not null);原创 2010-02-05 13:43:36 · 1115 阅读 · 0 评论 -
Oracle 修改列约束
ALTER TABLE table_name ADD [CONSTRAINT 约束名] 约束条件(column);not null:ALTER TABLE table_name MODIFY(col type NOT NULL);原创 2010-02-05 13:39:32 · 401 阅读 · 0 评论 -
Oracle 修改列类型
alter table table_name modify(column type);原创 2010-02-05 13:25:08 · 122 阅读 · 0 评论 -
Oracle 增加列
alter table table_name add (col1 type,col2 type);原创 2010-02-05 13:20:28 · 110 阅读 · 0 评论 -
Oracle 日期处理
今年:select extract(year from sysdate) from dual;今月:select extract(month from sysdate) from dual;今日:select extract(day from sysdate) from dual; select trunc(sysdate,'dd') from dual;今时:selec...原创 2010-02-03 13:36:05 · 61 阅读 · 0 评论 -
查看Oracle数据库版本
select * from v$version;原创 2010-02-02 17:32:14 · 67 阅读 · 0 评论 -
Oracle 中 rownum的用法
http://www.oracle.com/technology/oramag/oracle/06-sep/o56asktom.html Consider a query with this structure: select ..., ROWNUM from t where <where clause> group by <columns&...原创 2010-08-09 15:20:16 · 138 阅读 · 0 评论 -
oracle 表重命名
[code="sql"]ALTER TABLE old_table_name RENAME TO new_table_name;[/code]or[code="sql"]RENAME old_table_name to new_table_name;[/code][code="sql"]select tname from tab;[/code]2010-04-23 13:51:31 · 836 阅读 · 0 评论 -
判断表的主键
select a.table_name,b.column_name, b.position from USER_CONSTRAINTS a, USER_CONS_COLUMNS b where a.constraint_name = b.constraint_name and a.constraint_type='P' and b.table_name = 'ETL_NODE_RUN_...2010-04-07 19:46:32 · 697 阅读 · 0 评论 -
Oracle中修改字段名
alter table table_name rename column old_value to new_value;原创 2009-12-28 10:56:57 · 94 阅读 · 0 评论 -
Oracle主键自增长
-- 建表:create table test( id number(5) primary key, name varchar2(25));-- 建序列:create sequence s_testminvalue 1maxvalue 99999999999999999999999999start with 123increment by 1...2009-12-25 10:19:02 · 61 阅读 · 0 评论 -
new或old引用不允许在表层触发器中
create trigger t_test before insert on testbegin select s_test.nextval into :new.id from dual;end;改正为:create trigger t_test before insert on test [color=red]for each row[/color]begin sel...2009-12-25 10:16:42 · 910 阅读 · 0 评论 -
Oracle CHAR,VARCHAR,VARCHAR2类型的区别与使用
区别: 1.CHAR的长度是固定的,而VARCHAR2的长度是可以变化的, 比如,存储字符串“abc",对于CHAR (20),表示你存储的字符将占20个字节(包括17个空字符),而同样的VARCHAR2 (20)则只占用3个字节的长度,20只是最大值,当你存储的字符小于20时,按实际长度存储。 2.CHAR的效率比VARCHAR2的效率稍高。 3.目前VARCHAR是VA...原创 2009-12-25 10:00:07 · 57 阅读 · 0 评论 -
sqlload 的格式
/ora10g/product/10.2.0/bin/sqlldr userid=petl/petl@DSSDB control=/etl/filehome/runner1/load/tmp/L136142etl_test_1_merge_20100315verf.ctl direct=false errors=100 bad=/etl/filehome/runner1/load/tmp/L136...2010-03-16 10:55:12 · 196 阅读 · 0 评论 -
SQLLoad 的2100错误
1. If you have another machine that is working try the following, make a copy of the files in %oracle_home%\rdbms\mesg. From a working machine copy those same files to the same folder on the non worki...2010-03-12 17:31:00 · 132 阅读 · 0 评论 -
ORA-01747: user.table.column, table.column 或列说明无效
[code="java"]java.sql.SQLException: ORA-01747: user.table.column, table.column 或列说明无效[/code]原因:SQL语句中使用了oracle的关键字原创 2010-11-11 09:30:46 · 140 阅读 · 0 评论