473,770 Members | 4,198 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SQL0181N on nickname for union-all-view

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_MYT ABLE 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_MYT ABLE" 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.

Nov 12 '05 #1
6 3034

<_l*****@yahoo. com> wrote in message
news:11******** ************@g4 4g2000cwa.googl egroups.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_MYT ABLE 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_MYT ABLE" 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
Nov 12 '05 #2
Hmmm, although I know well what the SQL0181N code means, it's just a
bit strange
that "select count(*) from <nickname_schem a>.<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.

Nov 12 '05 #3

<_l*****@yahoo. com> wrote in message
news:11******** *************@z 14g2000cwz.goog legroups.com...
Hmmm, although I know well what the SQL0181N code means, it's just a
bit strange
that "select count(*) from <nickname_schem a>.<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
Nov 12 '05 #4
I have this problem before. Just drop the nickname, and create a new
one. Try it.

Nov 12 '05 #5
Rhino wrote:
<_l*****@yahoo. com> wrote in message
news:11******** *************@z 14g2000cwz.goog legroups.com...
Hmmm, although I know well what the SQL0181N code means, it's just a
bit strange
that "select count(*) from <nickname_schem a>.<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
Nov 12 '05 #6
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.

Nov 12 '05 #7

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

Similar topics

5
15801
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,
3
7668
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 would like the nickname to point to this alias, avoiding the obligation to drop and recreate the nickname any time. Thanks for your help,
6
6219
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 new columns. These columns are not seen in DB2 nickname definition. When we run the queries, we do not see these columns in the result. When we describe the nickname, these columns are not present.
13
3336
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 in a nickname table when I have new entries. I also have a table called TA where I enter requests, linking to the providers table with the license number. (The fullname field exists only in the providers table.) I'd like to be able to query the TA...
4
3211
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 on the source table - tooo large). So when I tried create table table1 as (select * from nickname) data initially deferred refresh deferred; it returned sql0142N error - sql statement not supported. Both source and target dbs are db2 version...
0
9425
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10231
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10059
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8887
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7416
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6679
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5313
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5452
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3972
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.