Not able to create Materialized query on AS400

前提是你 提交于 2019-12-11 08:55:35

问题


I get an error message when trying to create materialized query in as400 I use winSql for the connection. The syntax seems valid. Could you please point out what am I doing wrong?

This is the statement I am trying to execute

CREATE TABLE AAA.TEST_MQ AS
(
     SELECT test.*

    FROM
        AAA.TABLE_NAME test

)  REFRESH DEFERRED

This is the error message:

Error: SQL0104 - Token <END-OF-STATEMENT> was not valid. Valid tokens: IMMEDIATE <IDENTIFIER>. (State:37000, Native Code: FFFFFF98)

I Tried creating an immediate one as well.


回答1:


Try this:

CREATE TABLE AAA.TEST_MQ AS (
      SELECT test.*
      FROM
      AAA.TABLE_NAME test  )
    DATA INITIALLY DEFERRED 
    REFRESH DEFERRED 
    MAINTAINED BY USER 
    ENABLE QUERY OPTIMIZATION 
;

I use JaySQL Lite and it works.



来源:https://stackoverflow.com/questions/4843521/not-able-to-create-materialized-query-on-as400

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!