473,836 Members | 1,584 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to use sql to query from different database

hi, we use db2 udb v8.1 on windows, i am trying to use federated
database objects to create wrapper, even though i have update dbm cfg
using federated yes, i still get error "the instance for the db is not
enable for the specified action", do i miss sth else?
Nov 12 '05
20 17648
I think this is gonna be about naming conventions...w as that you with
assembler programming language background?

Here we go:

machine A, db X, user xixi, password one
machine B, db X, user xixi, password two
machine C, db X, user xixi, password three

X := database X on machine A
XB := database X on machine B
XC := database X on machine C

you sit at machine A:

db2 catalog tcpip node B remote B server 50000
db2 catalog tcpip node C remote C server 50000

db2 catalog db X as XB at node B
db2 catalog db X as XC at node C

db2 connect to X user xixi using one
db2 create wrapper NJIPD
db2 create server SB type DB2/NT version 8.1 wrapper NJIPD authorization
"xixi" password "two" options (node 'B', dbname 'XB')
db2 create server SC type DB2/NT version 8.1 wrapper NJIPD authorization
"xixi" password "three" options (node 'C', dbname 'XC')

db2 create user mapping for xixi server SB options (remote_authid 'xixi',
remote_password 'two')
db2 create user mapping for xixi server SC options (remote_authid 'xixi',
remote_password 'three')

db2 create nickname SB.sysdummy1 for SB.sysibm.sysdu mmy1
db2 create nickname SC.sysdummy1 for SC.sysibm.sysdu mmy1

db2 create view xixi (c1,c2) as select SB.ibmreqd, SC.ibmreqd from
SB.sysdummy1 SB, SC.sysdummy1 SC
db2 select * from xixi

compare the output.


"xixi" schrieb im Newsbeitrag
news:c0******** *************** ***@posting.goo gle.com...
ok, i have my local machine a and catalog remote server b, and c on
it, then i successfully create a server, user mapping and nickname
from database x on b (which i worked on my machine with database Y on
b machines(in order to select from different database at the same
time), now i try to compare two different database exist on different
machine (database X on machine b and database Y on machine c), so i
create a new wrapper under database x on b, try to create server ,
user mapping on database Y on c machine, when i say create server
command, with the new wrapper name i created, what authid and password
i should put, is remote server c's or remote server b's?, and for the
dbname, is remote server c's database Y name or alias name i cataloged
under my machine a?

"aka" <ak*@aka-soft.de> wrote in message news:<ca******* ***@online.de>. ..
"xixi" schrieb im Newsbeitrag
news:c0******** *************** ***@posting.goo gle.com...
hi, i have three db2 server running on three machine, one is my local
(a) , the other two is on differet server (node b and node c), i have
cataloged b and c database to my local a. b and c has same database
sets x, y, so i try to create a wrapper on b machine's x database,
create a server , which points to b machine database Y, then create
user mapping and nicknames successfully. then i try to do the same
thing from b machine x database to c machine y database (which has
alias name GN), so i still use the wrapper i created, try to do create
server command as you instructed, but gives me error SQL0204N "DRDA"

ok, DRDA was just an example, you did just right when changing this to the name of the wrapper that you created
is an undefined name. SQLSTATE=42704

then i change to this

D:\Program Files\IBM\SQLLI B\BIN>db2 create server S type DB2/UDB
version 8.1 wra
pper "NJIPD" authid "admin" password "diamond" options (node
'WEBDEMO', dbname '

the authid is remote server c's authid and password, node 'WEBDEMO" is
the remote server c 's node name i cataloged on my local machine a ,
but gives me error SQL1013N The database alias name or database name
"GN" could not be found. SQLSTATE=42705

please help.

as I understand you are now dealing with 3 nodes :) I'm also quite happy
that you obviously made your wrapper and server and nicknames on machine (a) successfully, right?
what I stated about the number of wrappers you should create was not very accurate. you have to create one wrapper on each database in which you will create servers. as long as you have only db2 family databases to access only the wrapper of type drda is needed.
now, with 3 node environment you potentiate your possibilities of mixing and matching. I see no problem in creating another server on your machine (a) wich wraps a database on machine (c), since this would be analog to what you already have done with a database on machine (b). so in my example you
change S to S2, R to R2 and Y to Y2 and of course the correct name of your wrapper. should work the same as with machine (b).
another possibility would be to create a wrapper, server, user mapping and nicknames from machine (b) to machine (c). you could achieve this easy by running the same steps as before in a db2 cmd window on machine (b). catalog machine (c) and the remote database, this time with db2 instance on machine (b) acting as client against (c).
as an excercise to you I let you figure out by yourself how to create a
wrapper on machine (a) that accesses an object on machine (b) which in turn is only another wrapper of an object from machine (c)...


Nov 12 '05 #21

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

Similar topics

by: Wescotte | last post by:
Here is a small sample program I wrote in PHP (running off Apache 1.3.31 w/ PHP 5.0.1) to help illustrates problem I'm having. The data base is using DB2 V5R3M0. The client is WinXP machine using the iSeries Client Access Driver ver to connect to the database. The problem is that executing the exact same SQL select statement more than twice int a row stops produces results. The first two instances will always produce the...
by: Umar Farooq | last post by:
Hello all, Please bear with the long explanation of my scenario. As I'm relatively new to the query world, I like to write my queries using the visual toos such as the "View" option in SQL Server or in MS Access. If I have a complicated query with sub-queries, I create a query (view1) as (for example): select ID,count(ID) as NumberOfUsers from tblContact
by: Steven D.Arnold | last post by:
I have a query which does not use column indexes that it should use. I have discovered some interesting behaviors of Postgres which may indicate a bug in the database's query planning. Take a look at the query below. There is a btree index on both m.account_id and a.account_id. Query (1) does not use the index on the messages table, instead opting for a full table scan, thus killing performance. The messages table can contain...
by: Geir Baardsen | last post by:
Hi! I might have a difficult cuestion. In our database we have registered different tyres with different dimensions from different suppliers that is both for summer and winter season. Now I have simplified the database by having a tblCategory, so that I can run queries with this condition. So all tyres that are for summerseason, will be in the category: Tyres/su-Pirelli and tyres for
by: Marizel | last post by:
I'm not sure there's an easy solution to this, but thought I'd ask. I often find myself with a query which I'd like to reuse, but with a different datasource. These datasources generally have identical field names. The queries select a subset of the fields, so "Select *" is not really an option. Is there an easy way to change the source of a query, either in the design grid or SQL display? I suppose I could copy the SQL into WordPad...
by: Ismail Rajput | last post by:
How to create SQL Sub-Query in ASP.NET , if the sub query retrieves records from another database ? For Example i have a Database A table A in one database B and a table B. I want to receive some records from Database B table B and save into Database A table A
by: cover | last post by:
I have a table with 50 fields that receive input depending on whether that input came in from a 'shaker' form or a 'conveyor' form. Input from the 'conveyor' form might populate 25 fields while input from the 'shaker' form will populate another 20-25 fields but not the same fields (however there are about 10 common fields to both). I'd thought about using two tables (one for 'conveyor' and the other for 'shaker') but thought I'd try just...
by: Daz | last post by:
Hi. I am trying to select data from two separate MySQL tables, where I cannot use join, but when I put the two select queries into a single query, I get an error telling me to check my syntax. Both of the queries work fine when I use them to query the MySQL server directly. My guess is that the MySQL extension only expects a single resource back from the database, but get's several, or that it just checks the statement first, and decides...
by: Bob Alston | last post by:
If you have an access form with record source being a straightforward query and where clause in the form definition, will the query be sent to the back end jet/Access database and executed there, withonly the record(s) meeting the criteria being returned to the front end? Is JetShowPlan a good tool to see that this is working? Bob
by: Phil Stanton | last post by:
I am running a query that calls a function used to format addresses depending on the width of a control on a report that shows that address. The same query is used as the RecordSource of lots of similar reports, but all with different sized Address text boxes. For the function to work, the report need to be open in design view, so that the Text Box Width can be "measured". The function is obviously called for each line of the query (about...
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
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,...
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...
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...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
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...
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...
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.