473,757 Members | 2,083 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DB2 federated procedure

Hi, All.

Is federated procedures between DB2 databases currently not supported
in WebSphere Federation Server 9.1 ???
I recieve next error when trying to create DB2 federated procedure :

SQL30090N Operation invalid for application execution environment.
Reason
code = "21". LINE NUMBER=1.

My environment is Windows 2003 SP1+DB2 9.1 ESE + WS FS 9.1

Dec 19 '06 #1
9 5748
mitek wrote:
Hi, All.

Is federated procedures between DB2 databases currently not supported
in WebSphere Federation Server 9.1 ???
I recieve next error when trying to create DB2 federated procedure :

SQL30090N Operation invalid for application execution environment.
Reason
code = "21". LINE NUMBER=1.

My environment is Windows 2003 SP1+DB2 9.1 ESE + WS FS 9.1
DRDA data sources do not (yet) support federated stored procedures:

http://publib.boulder.ibm.com/infoce...iyfafsp01.html

--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
Dec 19 '06 #2

Knut Stolze wrote:
>
DRDA data sources do not (yet) support federated stored procedures:

http://publib.boulder.ibm.com/infoce...iyfafsp01.html

--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
Hello Knut;
Can you clarify? Given two DB2 LUW v9.1 ESE servers, I am interested in
doing the following:
* Define a stored proc on SERVER B that uses the ADMIN_CMD() to load
from a cursor selecting data from SERVER A (which has a nickname to it
defined on SERVER B)
* Call the procedure that resides on SERVER B from SERVER A
(referencing it as a "federated stored procedure" nickname)

In essence, I want to work around the limitation that prevents me from
doing a "load from cursor" to a federated target. Is this possible?
Seems like it should be - especially when the servers are both DRDA.
Thanks for any insight.

Pete H

Jan 16 '07 #3
peteh wrote:
>
Knut Stolze wrote:
>>
DRDA data sources do not (yet) support federated stored procedures:

http://publib.boulder.ibm.com/infoce...iyfafsp01.html
>>

Can you clarify? Given two DB2 LUW v9.1 ESE servers, I am interested in
doing the following:
* Define a stored proc on SERVER B that uses the ADMIN_CMD() to load
from a cursor selecting data from SERVER A (which has a nickname to it
defined on SERVER B)
I don't see a problem with that, unless there are some restrictions on LOAD
in doing that.
* Call the procedure that resides on SERVER B from SERVER A
(referencing it as a "federated stored procedure" nickname)
That is not _yet_ supported.
In essence, I want to work around the limitation that prevents me from
doing a "load from cursor" to a federated target.
IMPORT is not an option, is it?

If I got this right, you would have a two-way federated setup. Server A
accesses Server B as data source while Server B also accesses Server A as
source. And you want to LOAD data into a foreign/remote table based on
data in a local table, right?

--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
Jan 16 '07 #4

Knut Stolze wrote:
* Call the procedure that resides on SERVER B from SERVER A
(referencing it as a "federated stored procedure" nickname)

That is not _yet_ supported.
Any general timeframe? I won't hold you to it - I just could use some
guidance for planning purposes.
IMPORT is not an option, is it?
No - we need to be SQL based. "Insert into ...Select... from..." syntax
is an option, but we like the speed of LOAD.
If I got this right, you would have a two-way federated setup. Server A
accesses Server B as data source while Server B also accesses Server A as
source. And you want to LOAD data into a foreign/remote table based on
data in a local table, right?
Yes, we want Server A to be able to call a proc that executes on Server
B. The proc running on Server B loads to a table from a cursor that
selects from a nickname that points to a table on Server A.

We do "load from cursor" when the cursor selects from a nickname with
no problems. The twist we are adding here is that we want to call that
procedure from Server A (via federated proc nickname).

In simplest terms, we want to work around the limitation that prevents
us from LOADing (via stored proc) to a federated target. If there is a
better way, I am all ears. Thanks very much for your response.

Pete H

Jan 16 '07 #5
peteh wrote:
>
Knut Stolze wrote:
* Call the procedure that resides on SERVER B from SERVER A
(referencing it as a "federated stored procedure" nickname)

That is not _yet_ supported.
Any general timeframe? I won't hold you to it - I just could use some
guidance for planning purposes.
Sometime in the future. (You don't really expect my to give you more
information, do you?)
>IMPORT is not an option, is it?
No - we need to be SQL based. "Insert into ...Select... from..." syntax
is an option, but we like the speed of LOAD.
But LOAD is not SQL either. It is a DB2 command.
>If I got this right, you would have a two-way federated setup. Server A
accesses Server B as data source while Server B also accesses Server A as
source. And you want to LOAD data into a foreign/remote table based on
data in a local table, right?
Yes, we want Server A to be able to call a proc that executes on Server
B. The proc running on Server B loads to a table from a cursor that
selects from a nickname that points to a table on Server A.

We do "load from cursor" when the cursor selects from a nickname with
no problems. The twist we are adding here is that we want to call that
procedure from Server A (via federated proc nickname).

In simplest terms, we want to work around the limitation that prevents
us from LOADing (via stored proc) to a federated target. If there is a
better way, I am all ears. Thanks very much for your response.
Here are a few ideas that I have to circumvent this issue:

(1) Create a table in Server B like this:

CREATE TABLE load_sources (
nickname VARCHAR(261),
target VARCHAR(261)
)@

Then put a trigger on that table, which invokes ADMIN_CMD and loads from the
nickname (pointing to Server A) into a local target table.

(The length of 261 originates from 128 bytes schema name, 128 bytes table
name, and 4 bytes for potential double-quotes for delimited schema/table
names, and 1 byte for the dot '.' separating schema/table names.)

(2) Use an external function that invokes the procedure (or even better yet
directly the LOAD API) on Server B. (See here: http://tinyurl.com/j5mxs
and http://tinyurl.com/2j79nk). Then invoke the function through DB2
federation.

I'm not sure if that would work reliably, because Server A may decide not to
push-down the function call.

(3) Could you establish a connection from your application directly to
Server B? If so, you could LOAD from a pipe, and the pipe is populated
with data from Server A. Thus, you wouldn't need a temp file to hold the
data to be loaded.

There are probably some other approaches, but I would have to think about
them a bit longer...

--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
Jan 17 '07 #6

Knut Stolze wrote:
Sometime in the future. (You don't really expect my to give you more
information, do you?)
Can't blame a guy for trying, can you? :-)
No - we need to be SQL based. "Insert into ...Select... from..." syntax
is an option, but we like the speed of LOAD.

But LOAD is not SQL either. It is a DB2 command.
True enough, but rhough the ADMIN_CMD interface and load from cursor,
it looks like SQL from a calling application...
Here are a few ideas that I have to circumvent this issue:

(1) Create a table in Server B like this:

CREATE TABLE load_sources (
nickname VARCHAR(261),
target VARCHAR(261)
)@

Then put a trigger on that table, which invokes ADMIN_CMD and loads from the
nickname (pointing to Server A) into a local target table.
This looks like it may work for us, but I need to think through how I
might surface errors back to the calling procedure (executing on Server
A) that inserts to the table on Server B triggering the load. It may be
a little too asynchronous. Definitely worth looking at though.
(2) Use an external function that invokes the procedure (or even better yet
directly the LOAD API) on Server B. (See here: http://tinyurl.com/j5mxs
and http://tinyurl.com/2j79nk). Then invoke the function through DB2
federation.
I'm trying to avoid external procedures. My goal is a "code free"
solution using SQL and native DBMS capabilities wherever possible.
(3) Could you establish a connection from your application directly to
Server B? If so, you could LOAD from a pipe, and the pipe is populated
with data from Server A. Thus, you wouldn't need a temp file to hold the
data to be loaded.
The application I'm using (on Server A) is a 3rd party component - with
a requirement of a stored proc interface. Anything I do has to be
encapsulated in a single stored procedure call. I can specify a proc
name and code the proc to accomplish what I want, but can't change the
calling application.
There are probably some other approaches, but I would have to think about
them a bit longer...
Let me know if the additional "requiremen ts" generate any other
creative approaches.

Knut - thanks so much for your thoughtful solution candidates. 1 looks
like it might be work-able, 2 would work if I bit the bullet on
external routines, 3 won't fit within my current constraints.
Pete H

Jan 17 '07 #7
peteh wrote:
>
Knut Stolze wrote:
>Sometime in the future. (You don't really expect my to give you more
information, do you?)

Can't blame a guy for trying, can you? :-)
No, of course not. ;-)

No - we need to be SQL based. "Insert into ...Select... from..." syntax
is an option, but we like the speed of LOAD.

But LOAD is not SQL either. It is a DB2 command.

True enough, but rhough the ADMIN_CMD interface and load from cursor,
it looks like SQL from a calling application...
All right. You got a point there.
>Here are a few ideas that I have to circumvent this issue:

(1) Create a table in Server B like this:

CREATE TABLE load_sources (
nickname VARCHAR(261),
target VARCHAR(261)
)@

Then put a trigger on that table, which invokes ADMIN_CMD and loads from
the nickname (pointing to Server A) into a local target table.

This looks like it may work for us, but I need to think through how I
might surface errors back to the calling procedure (executing on Server
A) that inserts to the table on Server B triggering the load. It may be
a little too asynchronous. Definitely worth looking at though.
I forgot to add the missing pieces.

Server B:
- table + trigger exists
- an error from the LOAD is returned by the trigger, preventing the
INSERT operation

Server A:
- nickname to "load_sourc es"
- an INSERT into the nickname is passed on to Server B
- if an error comes back from the INSERT, you know that the LOAD failed
>(2) Use an external function that invokes the procedure (or even better
yet
directly the LOAD API) on Server B. (See here: http://tinyurl.com/j5mxs
and http://tinyurl.com/2j79nk). Then invoke the function through DB2
federation.

I'm trying to avoid external procedures. My goal is a "code free"
solution using SQL and native DBMS capabilities wherever possible.
That narrows things down quite a bit...
>(3) Could you establish a connection from your application directly to
Server B? If so, you could LOAD from a pipe, and the pipe is populated
with data from Server A. Thus, you wouldn't need a temp file to hold the
data to be loaded.

The application I'm using (on Server A) is a 3rd party component - with
a requirement of a stored proc interface. Anything I do has to be
encapsulated in a single stored procedure call. I can specify a proc
name and code the proc to accomplish what I want, but can't change the
calling application.
Ugh. So we would be back to external procedures on Server A and/or Server
B.

One more idea: DB2 V9 supports IMPORT in the ADMIN_CMD procedure. Maybe
this is a way to go?

--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
Jan 17 '07 #8
Knut Stolze wrote:
One more idea: DB2 V9 supports IMPORT in the ADMIN_CMD procedure. Maybe
this is a way to go?
http://publib.boulder.ibm.com/infoce...c/r0012547.htm

--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
Jan 17 '07 #9

Knut Stolze wrote:
I forgot to add the missing pieces.

Server B:
- table + trigger exists
- an error from the LOAD is returned by the trigger, preventing the
INSERT operation

Server A:
- nickname to "load_sourc es"
- an INSERT into the nickname is passed on to Server B
- if an error comes back from the INSERT, you know that the LOAD failed
Thanks a million Knut! This looks like a solid solution that addresses
my error-handling concerns, supplies a "code free", SQL-based solution
callable from Server A. I really appreciate you closing the loop on
this.

Pete H

Jan 17 '07 #10

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

Similar topics

3
2964
by: Terry | last post by:
Hi All, Im trying to run db2expln over some sql in order to find out why its so slow. I receive the following error message. LINE MESSAGES FOR DYNEXPLN.sqc ------ -------------------------------------------------------------------- SQL0060W The "C" precompiler is in progress.
1
1995
by: RdR | last post by:
Hi, I have a table in SQL Server with no keys, I point this as a federated table in DB2 but in DB2 I have defined keys against this federated table in SQL. Where will the key constraints be followed in DB2 or in SQL? How should a select statement in DB2 for this federated table behave if there are duplicates in SQL? The result I am getting is it is showing an actual duplicate in DB2 for this federated table. Is there any setting in DB2...
4
606
by: uthuras | last post by:
Greetings all, Is it possible to have federated db feature implemented among DB2 family? I intend to create federated within DB2 databases. I have 2 databases TestA and TestB. I have some base tables in TestA database and the reference tables in TestB database. Now i want to select data from TestB database referencing base table in TestA database. One of the way would be Federated Database. I've seen some red books on setting up...
2
4865
by: vrbala | last post by:
Hi All, I have a issue in federated database. I will explain the scenario I have a table T1 in database called offlinedb. It has one column F1 I have an another table T2 in database uatdb. I added attached table T1 in offlinedb using Federated Objects. Then i created a procedure P1 in uatdb database with the following contents.
5
3343
by: Klemens | last post by:
I get SQL30090 reason 18 by trying to do an insert in a federated table and an update in a local table in one transaction Do I have to change some settings to get done or ist this not possible by definition? Thanks Klemens
0
1562
by: Antanas | last post by:
I want to insert in federated db TABLE1, when records get inserted into DSY.TABLEA table. CREATE TRIGGER DSY.TRIGA AFTER INSERT ON DSY.TABLEA REFERENCING NEW AS TriggeredRow FOR EACH ROW MODE DB2SQL INSERT INTO FEDSERV.TABLE1 (LOG_TIMESTAMP, USER_NAME) VALUES (CURRENT TIMESTAMP, TriggeredRow.NAME);
1
3395
by: Antanas | last post by:
I want to insert in federated db TABLE1, when records get inserted into DSY.TABLEA table. CREATE TRIGGER DSY.TRIGA AFTER INSERT ON DSY.TABLEA REFERENCING NEW AS TriggeredRow FOR EACH ROW MODE DB2SQL INSERT INTO FEDSERV.TABLE1 (LOG_TIMESTAMP, USER_NAME) VALUES (CURRENT TIMESTAMP, TriggeredRow.NAME);
2
1927
by: mas5 | last post by:
Hello, Sorry if my question is elementary. I've searched google, but can't seem to find exactly what I'm looking for. My client is using db2 8.2. They have 2 companies and each company has a different database running under the same instance. I have created a stored procedure in one database that takes data and inserts it into the other database. It works perfect when I call the procedure this way in the CLP "CALL DATACOPY(12345)"...I...
0
1087
by: And | last post by:
Hello everybody I’m facing the current challenge! I have an intranet built in federated search that allows me to search in different subscribed databases and at the same time I have a folder that works like the depository of all the documents that may have interest to my company. So, the procedure is: if someone finds a document with interest for the company it should catalog it and save it to this folder so that it can be searched by...
0
9487
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, 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...
0
9297
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
10069
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...
1
9884
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,...
0
8736
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...
0
5324
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3828
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
3
3395
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2697
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.