关闭

ORA-30078: partition bound must be TIME/TIMESTAMP WITH TIME ZONE literals

标签: 11gOracleSQLORA-30078timestamp
218人阅读 评论(0) 收藏 举报
分类:
11g Release 2 (11.2)

Example 4-9 Creating reference-partitioned tables

CREATE TABLE orders ( order_id NUMBER(12), order_date TIMESTAMP WITH LOCAL TIME ZONE, order_mode VARCHAR2(8), customer_id NUMBER(6), order_status NUMBER(2), order_total NUMBER(8,2), sales_rep_id NUMBER(6), promotion_id NUMBER(6), CONSTRAINT orders_pk PRIMARY KEY(order_id) ) PARTITION BY RANGE(order_date) ( PARTITION Q1_2005 VALUES LESS THAN (TO_DATE('01-APR-2005','DD-MON-YYYY')), PARTITION Q2_2005 VALUES LESS THAN (TO_DATE('01-JUL-2005','DD-MON-YYYY')), PARTITION Q3_2005 VALUES LESS THAN (TO_DATE('01-OCT-2005','DD-MON-YYYY')), PARTITION Q4_2005 VALUES LESS THAN (TO_DATE('01-JAN-2006','DD-MON-YYYY')) ); 

ERROR at line 13:
ORA-30078: partition bound must be TIME/TIMESTAMP WITH TIME ZONE literals

尝试解决如下步骤:
1.表中字段类型更改
a  
order_date TIMESTAMP
 创建成功
b  
order_date date
  创建成功

2. 
 PARTITION value 类型更改
a   
VALUES LESS THAN (TO_DATE('2016-06-01','YYYY-MM-DD'))
创建失败
b   
VALUES LESS THAN (timestamp'2016-06-01 00:00:00.000000')
创建失败
c  
 VALUES LESS THAN (timestamp('2016-06-01 00:00:00.000000','yyyy-mm-dd hh24:mi:ss.ff')) 
创建失败
d  
 VALUES LESS THAN (cast(to_date('2016-07-01','yyyy-mm-dd') as timestamp))
创建失败
e   
VALUES LESS THAN (TO_TIMESTAMP_TZ('2016-06-01 00:12:56.788 -12:44', 'YYYY-MM-DD HH24:MI:SS.FF TZH:TZM'))
 创建成功

以上为运行结果。
下面是参数信息,在下面两台数据库中测试,以上运行结果都相同。
NLS_LANGUAGE=SIMPLIFIED CHINESE
NLS_TERRITORY=CHINA

 NLS_LANGUAGE=AMERICAN
NLS_TERRITORY=AMERICA
0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:22248次
    • 积分:327
    • 等级:
    • 排名:千里之外
    • 原创:3篇
    • 转载:45篇
    • 译文:0篇
    • 评论:0条
    文章分类