473,386 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Inserting in federated db from trigger

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);

SQL30090N Operation invalid for application execution environment.
Reason
code = "22". LINE NUMBER=2. SQLSTATE=25000


So then I added PROCEDURE1, but this did not help:

CREATE TRIGGER DSY.TRIGA AFTER INSERT ON DSY.TABLEA
REFERENCING NEW AS TriggeredRow
CALL DB2ADMIN.PROCEDURE1(TriggeredRow.NAME);
CREATE PROCEDURE DB2ADMIN.PROCEDURE1 ( IN NAME VARCHAR(50) )
P1: BEGIN
INSERT INTO FEDSERV.OBELOGGING
INSERT INTO FEDSERV.TABLE1
(LOG_TIMESTAMP, USER_NAME)
VALUES (CURRENT TIMESTAMP, NAME);
END P1

SQL0723N An error occurred in a triggered SQL statement in trigger
"DSY.TRIGLOG". Information returned for the error includes SQLCODE
"-20136",
SQLSTATE "55047" and message tokens
"DB2ADMIN.PROCEDURE1|SQL051117152646510".
SQLSTATE=09000

How can I make it work?

Nov 18 '05 #1
0 1526

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

Similar topics

0
by: Joerg Ammann | last post by:
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...
3
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 ------ ...
1
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...
4
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...
5
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...
1
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...
2
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...
4
by: Praveen_db2 | last post by:
Hi All DB2 8.1.3,Windows I have 2 databases in a single instance, say DB_1 and DB_2.I need to query a table from DB_1 in DB_2.I am try to use a nickname for it.But nickname creation is not...
9
by: mitek | last post by:
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 : ...
0
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,...
0
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$) { } ...
0
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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,...
0
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...

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.