增加列后,默认精度改变 alter table fcdata_cj00 add (fc_qjs_2 NUMBER(25,6) default 0 not null); 后默认值为0 而不是0.000000;如果把not null 去掉 alter table fcdata_cj00 add (fc_qjs_2 NUMBER(25,6) default 0 ); 数据库的值就为0.00000了 求解 跪谢!!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 SQL> SQL> col c1 format 0000;SQL> create table test(c1 int);Table createdSQL> insert into test(c1) values(1);1 row insertedSQL> alter table test add c2 number(25,6) default 0 not null;Table alteredSQL> alter table test add c3 number(25,6) default 0;Table alteredSQL> insert into test(c1) values(2);1 row insertedSQL> select * from test; C1 C2 C3---- --------------------------- --------------------------- 1 0.000000 0.000000 2 0.000000 0.000000SQL> drop table test purge;Table droppedSQL> SQL> create table test111(c1 int);SQL> insert into test111(c1) values(1);SQL> alter table test111 add c2 number(25,6) default 0 not null;SQL> alter table test111 add c3 number(25,6) default 0;SQL> insert into test111(c1) values(2);SQL> select * from test111; C1 C2 C3---- --------------------------- --------------------------- 1 0 0.000000 2 0 0.000000大神为什么我的C2是0,而不是0.00000 是不是在sqlplus 里跑的? 那个只是显示的问题,数据没错。 我是在plsql 里面跑的 这个东东是不是与OS的环境设置也有关系啊。我显示结果,都是0.在sqlplus下。SQL> select * from test; C1 C2 C3---------- ---------- ---------- 1 0 0 2 0 0SQL> desc test 名称 是否为空? 类型 ----------------------------------------- -------- ---------------------------- C1 NUMBER(38) C2 NOT NULL NUMBER(25,6) C3 NUMBER(25,6) 我在sqlplus 里面显示的也都是0, 在plsql里面显示C2是0, C3是0.000000 不清楚为什么会这样 把number换成decimal试试看。 还有纠结这个呢, 这是两个客户端,属于显示格式的问题。sqlplus 里有 col col_name format 语法,可以设置。 SQL查询语句求助!!!! update 树递归 续 utl_file怎么指定导出excel的那个Sheet1的单元格格式全为文本型的? 在Oralce的高级复制中,如何实现表的动态拥有? 如何通过tigger控制数据库的登陆 oracle在solaris下的恢复 我是新来的,求解一个字符串处理的问题 一个简单的返回多个值的存储过程能这样写吗?? 存储过程中如何返回几个值。不能通过out参数 不能导入导出ORACLE表 求助:ORACLE数据库如何实现? ORA-03113: 通信通道的文件结尾和alert里的 ORA-07445: 出现异常错误
SQL>
SQL> col c1 format 0000;
SQL> create table test(c1 int);
Table created
SQL> insert into test(c1) values(1);
1 row inserted
SQL> alter table test add c2 number(25,6) default 0 not null;
Table altered
SQL> alter table test add c3 number(25,6) default 0;
Table altered
SQL> insert into test(c1) values(2);
1 row inserted
SQL> select * from test;
C1 C2 C3
---- --------------------------- ---------------------------
1 0.000000 0.000000
2 0.000000 0.000000
SQL> drop table test purge;
Table droppedSQL>
SQL> insert into test111(c1) values(1);
SQL> alter table test111 add c2 number(25,6) default 0 not null;
SQL> alter table test111 add c3 number(25,6) default 0;
SQL> insert into test111(c1) values(2);
SQL> select * from test111;
C1 C2 C3
---- --------------------------- ---------------------------
1 0 0.000000
2 0 0.000000大神为什么我的C2是0,而不是0.00000
---------- ---------- ----------
1 0 0
2 0 0SQL> desc test
名称 是否为空? 类型
----------------------------------------- -------- ----------------------------
C1 NUMBER(38)
C2 NOT NULL NUMBER(25,6)
C3 NUMBER(25,6)
还有纠结这个呢, 这是两个客户端,属于显示格式的问题。sqlplus 里有 col col_name format 语法,可以设置。