我有一个要求,我已经为物化视图访问了ddl并执行它。我已为物化视图创建脚本,如下所示:
x*(b-k)+k*(x+1) = a
b*x - k*x + k*x + k = a
b*x + k = a
我尝试了以下替换语句,但它不起作用:
CREATE MATERIALIZED VIEW "XXX"."AUD_MV_DCST" ("BUCKET", "ID", "SUM")
ORGANIZATION HEAP PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "USERS"
BUILD IMMEDIATE
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "USERS"
REFRESH FAST ON COMMIT
USING DEFAULT LOCAL ROLLBACK SEGMENT
USING ENFORCED CONSTRAINTS ENABLE QUERY REWRITE
AS SELECT TRUNC(STATUS_TIMESTAMP, 'HH24') BUCKET, ID, SUM(1)
.....
打破这个是什么
select replace(create_script, '''','''''') from dual
开合括号。我收到错误:
'HH24')
以下是执行此操作的存储过程:
ORA-00907: missing right parenthesis
ORA-06512: at "XXX.createProc", line 67
ORA-06512: at line 2
有关如何解决这个问题的任何建议?
答案 0 :(得分:0)
我尝试了以下内容并且没有任何问题:
SQL> select trunc(current_timestamp, 'HH24') BUCKET from dual;
BUCKET
------------------
20-NOV-15
SQL>
尝试不使用精确说明符并使用:
SQL> select trunc(current_timestamp) BUCKET from dual;
BUCKET
------------------
20-NOV-15
SQL>
HTH