Unix Technical Forum

Materialized Query Syntax--I can't get the samples to work

This is a discussion on Materialized Query Syntax--I can't get the samples to work within the DB2 forums, part of the Database Server Software category; --> This is a simplistic test table I am trying to create. The syntax is directly based up on the ...


Go Back   Unix Technical Forum > Database Server Software > DB2

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 04:13 AM
lread@dunbarton.com
 
Posts: n/a
Default Materialized Query Syntax--I can't get the samples to work

This is a simplistic test table I am trying to create. The syntax is
directly based up on the sample code from the BI Redbook:

CREATE TABLE CUSDTA021/MQT_DB AS
(
SELECT SUM(ML1OQ) AS TOTAL_SUM,
M1PN
FROM FRNDTA021/M1P M1P
WHERE M1LOT# = ''
GROUP BY M1PN
)

DATA INITIALLY DEFERRED --Create but don't populate
REFRESH DEFERRED --Populate/refresh later
--ENABLE QUERY OPTIMIZATION
--MAINTAINED BY USER ; --instead of system


When I run this command without the commented out parameters, I get the
error message "Valid tokens: ENABLE DISABLE" If I supply the ENABLE
QUERY OPTIMIZATION parameter, I get prompted for the MAINTAINED BY
parameter. I found these in the CREATE TABLE spec for materialized
queries, but they are not listed in the samples.

By putting in the commented out parameters, the table is created
without a hitch. Well, actually, the created table isn't journaled but
I don't really care about that. The problem I have is that I need to
create SYSTEM-maintained tables with a DEFERRED REFRESH so that I can
use staging tables.

Oddly enough, according to page 28 of the Redbook I am using as a guide
(SB24-6546-00) I shouldn't be able to populate the newly created table
using the REFRESH TABLE command. However, it works like a charm. What
I cannot do is a REFRESH TABLE INCREMENTAL, which is really why I am
having to fret over this syntax issue to such a degree.

Any clarification about why I can't create SYSTEM maintained tables
would be very welcome.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:24 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com