时间类型长度

1 测试一

SQL> create table test(create_time timestamp(6));
 
Table created
 
SQL> insert into test values(sysdate);
 
1 row inserted
 
SQL> commit;
 
Commit complete
 
SQL> select dump(CREATED_TIME) from test;
 
select dump(CREATED_TIME) from test
 
ORA-00904: "CREATED_TIME": 标识符无效
 
SQL> select dump(create_time) from test;
 
DUMP(CREATE_TIME)
--------------------------------------------------------------------------------
Typ=180 Len=7: 120,113,10,28,17,22,12
 
SQL> create table test1 (create_time timestamp);
 
Table created
 
SQL> insert into test1 values(sysdate);
 
1 row inserted
 
SQL> commit;
 
Commit complete
 
SQL> select dump(create_time) from test1;
 
DUMP(CREATE_TIME)
--------------------------------------------------------------------------------
Typ=180 Len=7: 120,113,10,28,17,23,60
 
SQL> create table test2 (create_time date);
 
Table created
 
SQL> insert into test2 values(sysdate);
 
1 row inserted
 
SQL> commit;
 
Commit complete
 
SQL> select dump(create_time) from test2;
 
DUMP(CREATE_TIME)
--------------------------------------------------------------------------------
Typ=12 Len=7: 120,113,10,28,17,25,44
 
SQL>

 

2 测试2

 

SQL> select dump(to_timestamp('2013-09-10','yyyy-mm-dd')) from dual;
 
DUMP(TO_TIMESTAMP('2013-09-10'
--------------------------------------------------------------------------------
Typ=187 Len=20: 221,7,9,10,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0
 
SQL> select dump(to_date('2013-09-10','yyyy-mm-dd')) from dual;
 
DUMP(TO_DATE('2013-09-10','YYY
--------------------------------------------------------------------------------
Typ=13 Len=8: 221,7,9,10,0,0,0,0
 
SQL>

 

 

注:怎么两个案例时间类型的长度是不一致的呢????

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值