473,382 Members | 1,258 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

SQL statement not supported error SQL1042N for MQT defn on a nickname

I have a problem, I am getting SQL1042N The SQL statement is not
supported. error when I try to create a MQT against a nickname. The
source db is db2 version 9.1 fixpack 4, same as the target db and so
the SQL is definitely supported and both are in windows 2003 server.
Is there a way I could find why this error pops up.
My syntax is like

create mqt1 as
(select col1, col2, ..............., colN from nickname where
<predicate>) data initially deffered refresh deffered;

To add an aggregation, I also tried the following

create mqt1(count1,col1,col2...colN) as
(select count(*), col1, col2, ..............., colN from nickname
where <predicategroup by col1,col2...colN) data initially deffered
refresh deffered;
Still no joy.

Also, basically what I am trying to do is the following :
I have a table in one server, and since it is not a big table, I am
thinking of creating a replicated MQT (basically I need all the
columns of the table), in a linux cluster database of 8 nodes, so that
I have a local table and also since it is replicated, collocating
joins can be achieved.
I can go and load local table using db2 load command, but I'd have to
do this everytime I start a process, which is painful. Also, I can't
achieve this intra-db replication using local table, can I?
Any advise would be appreciated.

Thanks
Arun
Jun 27 '08 #1
7 3218
MQTs in DB2 are created using the CREATE TABLE statement, looks like
you're missing the TABLE part...

Regards,
Miro
Jun 27 '08 #2
On May 29, 4:18*pm, mirof007 <mirof...@gmail.comwrote:
MQTs in DB2 are created using the CREATE TABLE statement, looks like
you're missing the TABLE part...

Regards,
Miro
I did use that, no probs with syntax buddy. If that was the case I'd
have got another error. All am facing now is problem with the whole
exercise, that it is not allowed in my environment and am trying to
find out why.
Jun 27 '08 #3
Can anyone care to advise me on this please?
Jun 27 '08 #4
Anrun,

Can you please post teh extact error message. I get under 1042 this:
SQL1042C An unexpected system error occurred.

Clearly NOT an MQT specific error message.
Do you loose the connection when this happens? Do you need to restart
DB2? Anything in the db2diag.log ("severe").

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Jun 27 '08 #5
I needed to transfer data from one db to another in a seamless way, so
the idea I had was to build an MQT against a nickname, and refresh
data. When I created the mqt like,
create table mqt
as
(select col1, col2,.... from table1) data initially deferred refresh
deferred;

it gave back an error saying

DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL0142N The SQL statement is not supported.

For not giving a fullselect, what I did was to include a dumb count(*)
and group by the primary key so as to use aggregation. But got back
the same error,
I am trying this option so that I won't have the hassles of load
utility to load the data into the local table everyweek, since the
data is not big.
So what I want to find is why db2 is throwing that error. SQL
statement is fine and I am using data deferred since it's a nickname
am building the MQT against.
No disconnects, and I've checked the diaglog, no messages. Still a big
mystery.
Jun 27 '08 #6
Arun Srinivasan wrote:
I needed to transfer data from one db to another in a seamless way, so
the idea I had was to build an MQT against a nickname, and refresh
data. When I created the mqt like,
create table mqt
as
(select col1, col2,.... from table1) data initially deferred refresh
deferred;

it gave back an error saying

DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL0142N The SQL statement is not supported.

For not giving a fullselect, what I did was to include a dumb count(*)
and group by the primary key so as to use aggregation. But got back
the same error,
I am trying this option so that I won't have the hassles of load
utility to load the data into the local table everyweek, since the
data is not big.
So what I want to find is why db2 is throwing that error. SQL
statement is fine and I am using data deferred since it's a nickname
am building the MQT against.
No disconnects, and I've checked the diaglog, no messages. Still a big
mystery.
If you don't want the hassles of the LOAD utility - how about the
IMPORT utility instead? Nothing like as quick admittedly, but then it's
likely to be a good bit faster than using a federated MQT, and will
avoid all this trouble.

As for whether or not it's as "seamless" ... well, it may involve two
commands (EXPORT + IMPORT) instead of one (REFRESH TABLE) but that just
means it's a scheduled script with two lines instead of one ;-)
Cheers,

Dave.

--

Jun 27 '08 #7
On Jun 2, 6:12*pm, "Dave Hughes" <d...@waveform.plus.comwrote:
Arun Srinivasan wrote:
I needed to transfer data from one db to another in a seamless way, so
the idea I had was to build an MQT against a nickname, and refresh
data. When I created the mqt like,
create table mqt
as
(select col1, col2,.... from table1) data initially deferred refresh
deferred;
it gave back an error saying
DB21034E *The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. *During SQL processing it
returned:
SQL0142N *The SQL statement is not supported.
For not giving a fullselect, what I did was to include a dumb count(*)
and group by the primary key so as to use aggregation. But got back
the same error,
I am trying this option so that I won't have the hassles of load
utility to load the data into the local table everyweek, since the
data is not big.
So what I want to find is why db2 is throwing that error. SQL
statement is fine and I am using data deferred since it's a nickname
am building the MQT against.
No disconnects, and I've checked the diaglog, no messages. Still a big
mystery.

If you don't want the hassles of the LOAD utility - how about the
IMPORT utility instead? Nothing like as quick admittedly, but then it's
likely to be a good bit faster than using a federated MQT, and will
avoid all this trouble.

As for whether or not it's as "seamless" ... well, it may involve two
commands (EXPORT + IMPORT) instead of one (REFRESH TABLE) but that just
means it's a scheduled script with two lines instead of one ;-)

Cheers,

Dave.

--- Hide quoted text -

- Show quoted text -
Thanks Dave. But if you read my initial request, another great
advantage I have using MQTs is that I can replicate them across all
nodes.
'I have a table in one server, and since it is not a big table, I am
thinking of creating a replicated MQT (basically I need all the
columns of the table), in a linux cluster database of 8 nodes, so
that
I have a local table and also since it is replicated, collocating
joins can be achieved.
I can go and load local table using db2 load command, but I'd have to
do this everytime I start a process, which is painful. Also, I can't
achieve this intra-db replication using local table, can I? '

Can we do this using simple table and loading them (one in each
partition), and thereby achieve collocating joins?
Please advise.
Jun 27 '08 #8

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

Similar topics

4
by: James E Koehler | last post by:
I can't get the WHILE statement to work in MySQL. The version of MySQL that I am using is: Ver 12.16 Distrib 4.0.6-gamma, for Win95/Win98 (i32) running on Windows MX. Here is the relevant...
5
by: Rafael Faria | last post by:
Hello All, I'm new to DB2, so apologies in advance for any stupid comments I might make on this replication problem. Using Information integrator and DB2 8.2 I managed to create a nickname that...
6
by: _link98 | last post by:
Problem: getting SQL0181N for queries on nicknames to remote Union-All-View. Can't see what I'm doing wrong yet, maybe someone has seen this before. Environment: UDB ESE 8.1 + FIXPAK 9A, on...
2
by: Scott Reynolds | last post by:
I am having a problem exposing a class inherited from the collection base class as a webservice. If I expose the collection on a web page all works well and I am very happy. However when I try and...
28
by: Steven Bethard | last post by:
Ok, I finally have a PEP number. Here's the most updated version of the "make" statement PEP. I'll be posting it shortly to python-dev. Thanks again for the previous discussion and suggestions!...
7
by: Steven Bethard | last post by:
I've updated PEP 359 with a bunch of the recent suggestions. The patch is available at: http://bugs.python.org/1472459 and I've pasted the full text below. I've tried to be more explicit about...
6
by: Prasad | last post by:
Hi, We have DB2 7 fixpak 14 on AIX 5.1. There are federated links (nicknames) established for tables in Informix database. One of the table was modified in Informix. The table has now got 3...
2
by: juan.gautier | last post by:
Hi, I try to construct a SQL code for a view to select a specific data from a table, this query take the value of the filter from a text box in a visual basic 6.0 form. my problem is when i...
13
by: CindySue | last post by:
I have a table of providers that has a license number and fullname field, among others. Deman helped me with being able to enter a nickname and having it change to the fullname if a nickname exists...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.