473,503 Members | 5,284 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Invalid fullselect specified for MQT, more info available?

Hi,

I am trying to investigate if some of our fairly complex views
couldn't be materialised with MQT's.

Unfortunately the error message returned when the fullselect is
invalid is as
shown at the bottom of this post.

This message does little/nothing to help me(the user) understand what
is precluding the MQT. I then have to wade through all the if-buts
etc... to do with MQTs (very time consuming!)

Couldn't a more useful message of exactly why the definition is
unacceptable
be given? Surely, db2 knows exactly what the rule that has been broken
is ?

Thanks.

Paul

"SQL20058N The fullselect specified for the materialized query
table "<table-name>" is not valid.

Explanation:

The materialized query table definition has specific rules
regarding the contents of the fullselect. Some rules are based
on the materialized query table options (REFRESH DEFERRED or
REFRESH IMMEDIATE) while others are based on whether or not the
table is replicated. The fullselect in the CREATE TABLE
statement that returned this condition violates at least one of
the rules as described in the SQL Reference.

The statement cannot be processed.

User Response:

Change the fullselect in the CREATE TABLE statement so that it
conforms to the rules based on the materialized query table
options and whether or not the materialized query table is
replicated. "
Nov 12 '05 #1
8 4787
"Paul Reddin" <pa**@abacus.co.uk> wrote in message
news:1f**************************@posting.google.c om...
Hi,

I am trying to investigate if some of our fairly complex views
couldn't be materialised with MQT's.

Unfortunately the error message returned when the fullselect is
invalid is as
shown at the bottom of this post.

This message does little/nothing to help me(the user) understand what
is precluding the MQT. I then have to wade through all the if-buts
etc... to do with MQTs (very time consuming!)

Couldn't a more useful message of exactly why the definition is
unacceptable be given?


I'm sure it could, but then the standard

SQL0104N An unexpected token "END-OF-STATEMENT" was found following "lect
from plain_text". Expected tokens may include: "<table_expr>".

can be prety obtuse also.

An interactive, client-side, as-you-type parser would get my vote.

In the meantime, Greame Birchall's DB2 cookbook arguably lists the MQT
restrictions in a more easy to read format.
See page 211 on his latest copy (updated 1st Jan 2004)
http://ourworld.compuserve.com/homep...l/HTM_COOK.HTM
E.g. is
"Every select list element must have a name"

easier to understand than

"Every column selected must have a name."

?
Regards
Paul Vernon
Business Intelligence, IBM Global Services
Nov 12 '05 #2
Paul,

Thanks for your thoughts, I agree, and yes Graeme's version of things
can be much easier to read/decipher more quickly.

In this case though, I'm not sure he hasn't got a couple of
restrictions wrong

e.g
• The SELECT statement must contain a GROUP BY, unless REPLICATED is
specified,
in which case a GROUP BY is not allowed.
• The SELECT must have a COUNT(*) or COUNT_BIG(*) column.

??

At least judging by my reading of the Redbook on MQTs

i.e it reads like a GROUP BY is now optional, but if you do include
one then you must include a COUNT(*)

Which all goes to show that really the error message ideally needs to
define
exactly what the violation is, otherwise you are down to checking
through
many versions of rules which may or may not be correct/relevant
etc.....

Paul.
Nov 12 '05 #3
Known issue. We are looking into it.

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab

Nov 12 '05 #4
There's been some restriction liftings from time to time.
Join is now also possible in mqt's.

Graeme can't update his books on every fixpack though.

No count(), no group by, ...

db2 => CREATE TABLE TEST.SAMPBASE (
db2 (cont.) => Machine SMALLINT NOT NULL,
db2 (cont.) => SerialNo CHAR(10) NOT NULL,
db2 (cont.) => Color CHAR(10) NOT NULL,
db2 (cont.) => Weight SMALLINT NOT NULL,
db2 (cont.) => DateMade DATE NOT NULL,
db2 (cont.) => PRIMARY KEY (SerialNo)) @
DB20000I The SQL command completed successfully.
db2 =>
db2 =>
db2 => CREATE SUMMARY TABLE TEST.SAMPSUMM
db2 (cont.) => AS
db2 (cont.) => (
db2 (cont.) => SELECT * FROM TEST.SAMPBASE
db2 (cont.) => )
db2 (cont.) => DATA INITIALLY DEFERRED REFRESH deferred enable QUERY
OPTIMIZATION@
DB20000I The SQL command completed successfully.
db2 =>
PM
"Paul Reddin" <pa**@abacus.co.uk> a écrit dans le message de
news:1f**************************@posting.google.c om...
Paul,

Thanks for your thoughts, I agree, and yes Graeme's version of things
can be much easier to read/decipher more quickly.

In this case though, I'm not sure he hasn't got a couple of
restrictions wrong

e.g
. The SELECT statement must contain a GROUP BY, unless REPLICATED is
specified,
in which case a GROUP BY is not allowed.
. The SELECT must have a COUNT(*) or COUNT_BIG(*) column.

??

At least judging by my reading of the Redbook on MQTs

i.e it reads like a GROUP BY is now optional, but if you do include
one then you must include a COUNT(*)

Which all goes to show that really the error message ideally needs to
define
exactly what the violation is, otherwise you are down to checking
through
many versions of rules which may or may not be correct/relevant
etc.....

Paul.

Nov 12 '05 #5
Well, while the Paul s were talking about mqt's, i came across this doc
snippet while reviewing the subject.

(v8 fp4's doc)
In general a materialized query table, or a replicated materialized query
table, is used for optimization of a query if the isolation level of the
materialized query table, or the replicated materialized query table, is
higher than or equal to the isolation level of the query. For example, if a
query is running under the cursor stability (CS) isolation level, only
materialized query tables, and replicated materialized query tables, that
are defined under CS or higher isolation levels are used for optimization.
Should i be able to find a column in some syscat.* view where i'd find a
table name (TABNAME) with a defined isolation level (ISOLATION)?

If not (and it's probably the case), how do i know the isolation level an
mqt was defined under?

As far as i know, there is no such thing as a table's isolation level.

Any comments?

PM
Nov 12 '05 #6
Sorry, this should have been a new thread...

PM
Nov 12 '05 #7
Yes,

I saw this too and was very curious about it, but put it to one
side in amongst all the other things about MQTs I was trying to decipher/remember!
I mean it is the consumer that has a isolation level associated not a database
object?

Paul.

"PM \(pm3iinc-nospam\)" <PM(pm3iinc-nospam)@sympatico.ca> wrote in message news:<SM******************@news20.bellglobal.com>. ..
Sorry, this should have been a new thread...

PM

Nov 12 '05 #8
I didn't realize a table had an isolation level defined against it either.
However, if you issue the command "db2cat -d db-name -s schema-name -n
tab-name" (where schema-name and tab-name is your MQT), in the "PD extension
DESCRIPTION" area, there is an isolation level for the MQT.

"PM (pm3iinc-nospam)" <PM(pm3iinc-nospam)@sympatico.ca> wrote in message
news:UK******************@news20.bellglobal.com...
Well, while the Paul s were talking about mqt's, i came across this doc
snippet while reviewing the subject.

(v8 fp4's doc)
In general a materialized query table, or a replicated materialized query
table, is used for optimization of a query if the isolation level of the
materialized query table, or the replicated materialized query table, is
higher than or equal to the isolation level of the query. For example, if a query is running under the cursor stability (CS) isolation level, only
materialized query tables, and replicated materialized query tables, that
are defined under CS or higher isolation levels are used for optimization.
Should i be able to find a column in some syscat.* view where i'd find a
table name (TABNAME) with a defined isolation level (ISOLATION)?

If not (and it's probably the case), how do i know the isolation level an
mqt was defined under?

As far as i know, there is no such thing as a table's isolation level.

Any comments?

PM

Nov 12 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3993
by: Sam Smith | last post by:
I am using optparse for the commandline parsing for my programs. I was wondering if it is possible to detect if an option or option-arg has been specified on the commandline by the user or not....
2
22745
by: hvaisane | last post by:
Valgrind says ==11604== Invalid read of size 4 ==11604== at 0x8048ABB: main (foo.cc:36) ==11604== Address 0x1B92415C is 4 bytes inside a block of size 8 free'd ==11604== at 0x1B90514F:...
1
1612
by: STeve | last post by:
Hi guys, In my active directory class I was wondering how I would be able to catch invalid UserID's entered by the user. For example say if the user entered in a UserID as a. (well any set of...
0
1673
by: Alan Z. Scharf | last post by:
Win Server 2003 VS.Net 2003 --------------- 1. I'm having the same problem below on all six of my pages with a datagrid item. 2. These pages all worked fine for months until problem started....
4
4025
by: Ersin Gençtürk | last post by:
Server : WEB System.Web.HttpUnhandledException: Exception of type System.Web.HttpUnhandledException was thrown. ---> System.Web.HttpException: The View State is invalid for this page and might be...
5
3393
by: Nick Flandry | last post by:
I'm running into an Invalid Cast Exception on an ASP.NET application that runs fine in my development environment (Win2K server running IIS 5) and a test environment (also Win2K server running IIS...
3
2266
by: John Howard | last post by:
Making the following call to a local MSAccess database works fine: Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs) Dim intRows As Integer Dim strSQL As String Dim ds As New...
15
2216
by: David | last post by:
Hi, I have built a web application that will be a very high profile application. We had tested it, demonstrated it and shown that it all works. On a dress rehearsal run through, it failed...
2
8209
by: Eric Renken | last post by:
I have a Windows .NET 2.0 application that has been working fine for last year, and now all of a sudden on one customers computer I am getting this error, "Binary format of the specified custom...
0
7194
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7070
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7267
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7316
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7449
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5566
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4993
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
372
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.