By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,492 Members | 1,261 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,492 IT Pros & Developers. It's quick & easy.

Federated DB, access to remote sequence

P: n/a
hello,

we are using:
- DB2 UDB V 8.1 FP-6 on LINUX as (local) federated DB
- DB2 UDB V 7.2 on AIX as datasource

we try to move part of an application (most of the tables) von AIX to
LINUX and acess a few remaining tables (on AIX) via the "federated DB"
feature.

setup (SERVER, WRAPPER, NICKNAMES, etc.) worked and select, insert on
the remote (AIX) tables works fine.
now i have the problem that i must access (get the NEXTVAL) of a
sequence which is remote defined (because i need it in a local
trigger, i dont't think that i can use the PASSTHRU option).

i next tried to define a remote function (which gets the NEXTVAL) and
map a local function to it.

didn't worked either (see below).
anybody, any ideas ? how to do it ?

joerg

----------------
CREATE FUNCTION GWV.jam_odsfunc(seqvalue BIGINT)
RETURNS BIGINT
LANGUAGE SQL
READS SQL DATA
NOT DETERMINISTIC
NO EXTERNAL ACTION
RETURN
values(nextval for gwv.ereignissequence)

DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL0348N "NEXTVAL FOR GWV.EREIGNISSEQUENCE" cannot be specified in
this
context. LINE NUMBER=8. SQLSTATE=428F9
------------------
Nov 12 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.