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 Solaris 8.1, with 64-bit
instances.
I have a NICKNAME called REMOTE_DW.T_MYTABLE which points to a
"union-all-view".
Several other nicknames exist to regular-tables and regular views in
the remote database.
The "union-all-view" is in a database in another instance on the same
hostname,
(the remote-database).
If I perform "select count(*) on REMOTE_DW.T_MYTABLE" then the result
is SQL0181N
(i.e. while connected as the instance-owner to the federated database
in which
there is a nickname for the union-all-view on the remote database).
The "union-all-view" has a partitioning-column of type DATE, if that's
important.
But if I perform that same query on the other database directly (i.e.
not using the nickname, using a direct connection to the remote
database),
then the query gives the correct count of rows.
Additionally, if I perform simple queries on nicknames that are NOT to
"union-all-view"
(i.e. they point to reguar tables, or regular views) then these queries
also work OK
on the federated database.
The symptom is specific to queries on nicknames for "union-all-views".
For both the local database, and the "remote" database, the
authorization-id is that of
the respective instance-owners. There is a "user-mapping" for the
local-instance-owner
to the remote-instance-owner. 6 3008
<_l*****@yahoo.com> wrote in message
news:11********************@g44g2000cwa.googlegrou ps.com... 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 Solaris 8.1, with 64-bit instances.
I have a NICKNAME called REMOTE_DW.T_MYTABLE which points to a "union-all-view". Several other nicknames exist to regular-tables and regular views in the remote database.
The "union-all-view" is in a database in another instance on the same hostname, (the remote-database).
If I perform "select count(*) on REMOTE_DW.T_MYTABLE" then the result is SQL0181N (i.e. while connected as the instance-owner to the federated database in which there is a nickname for the union-all-view on the remote database).
The "union-all-view" has a partitioning-column of type DATE, if that's important.
But if I perform that same query on the other database directly (i.e. not using the nickname, using a direct connection to the remote database), then the query gives the correct count of rows.
Additionally, if I perform simple queries on nicknames that are NOT to "union-all-view" (i.e. they point to reguar tables, or regular views) then these queries also work OK on the federated database.
The symptom is specific to queries on nicknames for "union-all-views".
For both the local database, and the "remote" database, the authorization-id is that of the respective instance-owners. There is a "user-mapping" for the local-instance-owner to the remote-instance-owner.
SQL0181N is a very common error and is documented in the
Reference/Messages/SQL portion of the Information Center. It simply
indicates that some portion of a date is out of range. For instance, if you
construct a date that has a month of 15 or a year that is outside of the
range 1 to 9999, you'll get an SQL0181N. Look at the expressions that you
are creating based on the values in your Date column and I fully expect that
you'll find a bad date expression causing your error.
I don't think the nickname or the fact that you are using UNION ALL is a
real factor in the problem, just red herrings tripping you up.
Rhino
Hmmm, although I know well what the SQL0181N code means, it's just a
bit strange
that "select count(*) from <nickname_schema>.<union-all-view>"
gives the SQL0181N, even when all target tables of the view are empty,
and
there's no dates specified on the query.
<_l*****@yahoo.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com... Hmmm, although I know well what the SQL0181N code means, it's just a bit strange that "select count(*) from <nickname_schema>.<union-all-view>" gives the SQL0181N, even when all target tables of the view are empty, and there's no dates specified on the query.
Sorry, I didn't read your question as carefully as I should have. I agree
that the full set of symptoms makes my original suggestion a bit improbable.
But I'm at a loss to suggest any good explanations for why you're seeing
this behaviour.
As for resolving the problem, I suggest that you look through the APAR lists
and see if there are any recent fixes involving SQL0181N; install the
appropriate fixpack if you find such an APAR. If you can't find any fixpack
that resolves the problem, call IBM Support for some help in tracking this
down.
Rhino
I have this problem before. Just drop the nickname, and create a new
one. Try it.
Rhino wrote: <_l*****@yahoo.com> wrote in message news:11*********************@z14g2000cwz.googlegro ups.com...
Hmmm, although I know well what the SQL0181N code means, it's just a bit strange that "select count(*) from <nickname_schema>.<union-all-view>" gives the SQL0181N, even when all target tables of the view are empty, and there's no dates specified on the query.
Sorry, I didn't read your question as carefully as I should have. I agree that the full set of symptoms makes my original suggestion a bit improbable.
But I'm at a loss to suggest any good explanations for why you're seeing this behaviour.
As for resolving the problem, I suggest that you look through the APAR lists and see if there are any recent fixes involving SQL0181N; install the appropriate fixpack if you find such an APAR. If you can't find any fixpack that resolves the problem, call IBM Support for some help in tracking this down.
Rhino
I agree, support.
Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Thanks mike_li, just dropping and recreating the nickname was not
enough to fix it.
Instead, I studied the column check constraint on the target tables of
the union-all-view.
Could not see any problem, but as a trial I dropped and recreated the
check-constraints
on the partitioning column, for each union-all-view, and that worked
(did not even need
to disconnect from the federated database or remake nicknames).
There's a weirdness in there somewhere but I need to have a recreatable
scenario
before opening a PMR , so I'll work on that later. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Jiggaz |
last post by:
Hi,
Look my stored procedure :
__________________
ALTER PROCEDURE dbo.CreateAccount
@Nickname varchar(30),
@Password varchar(15),
@Email varchar(50),
@Date datetime,
|
by: Jean-Marc Blaise |
last post by:
Hi,
Is there any reason why a CREATE NICKNAME statement fails if the remote
object is an ALIAS ?
I actually have an ALIAS that is used to point to the correct table in the
remote DB, and...
|
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...
|
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...
|
by: Arun Srinivasan |
last post by:
I need to create an MQT on a nickname, the requirement is that I need
to transfer data from source to target when required (this is because
the nickname is slow - i can't implement required indices...
|
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,...
|
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$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
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...
|
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,...
|
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...
| |