Discussion:
Trigger insert data through federated table
(too old to reply)
Bruno Almeida
2012-01-26 16:03:07 UTC
Permalink
Hello all,

DB2 v9.5 fixpack 5 LUW.

I need insert values on a federated table using a trigger.

Is that possible?

Actually, I´ve got this SQL ERROR on my trigger creation:

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

Is there another way to do this?

Regards,

Bruno
Lennart Jonsson
2012-01-26 18:44:19 UTC
Permalink
Post by Bruno Almeida
Hello all,
DB2 v9.5 fixpack 5 LUW.
I need insert values on a federated table using a trigger.
Is that possible?
No, you can't update both systems within the same transaction
Post by Bruno Almeida
SQL30090N Operation invalid for application execution environment.
Reason
code = "22". LINE NUMBER=8. SQLSTATE=25000
Is there another way to do this?
Some kind of replication would do. Other ways to break up the
transaction would be to have some kind of daemon that periodically
checks if there is something that needs dealing with.

From time to time I have had the same need as you are discussing here,
but I have never figured out a satisfactory solution. If you do come up
with something clever, I'm all ears.


/Lennart
Helmut Tessarek
2012-01-26 19:02:11 UTC
Permalink
Post by Lennart Jonsson
No, you can't update both systems within the same transaction
What about 2-phase commit?
--
Helmut K. C. Tessarek
DB2 Performance and Development
IBM Toronto Lab
Lennart Jonsson
2012-01-27 22:02:31 UTC
Permalink
Post by Helmut Tessarek
Post by Lennart Jonsson
No, you can't update both systems within the same transaction
What about 2-phase commit?
Post by Lennart Jonsson
I need insert values on a federated table using a trigger.
Is that possible?
No, you can't update both systems within the same transaction
how could a two-phase commit be applied here?


/Lennart
Bruce
2012-02-03 14:20:13 UTC
Permalink
Post by Lennart Jonsson
Post by Helmut Tessarek
Post by Lennart Jonsson
No, you can't update both systems within the same transaction
What about 2-phase commit?
Post by Lennart Jonsson
I need insert values on a federated table using a trigger.
Is that possible?
No, you can't update both systems within the same transaction
how could a two-phase commit be applied here?
/Lennart
is he really asking to insert into two tables at the same time? or
simply to insert into a table that'd somewhere else but accessible
through federation...if the latter is the question then wouldn't an
instead-of trigger work?
Lennart Jonsson
2012-02-07 20:19:23 UTC
Permalink
On 2012-02-03 15:20, Bruce wrote:
[...]
Post by Bruce
is he really asking to insert into two tables at the same time? or
simply to insert into a table that'd somewhere else but accessible
through federation...if the latter is the question then wouldn't an
instead-of trigger work?
Why bother using a trigger in that case?


/Lennart
Frederik Engelen
2012-02-08 09:22:05 UTC
Permalink
Post by Lennart Jonsson
[...]
Post by Bruce
is he really asking to insert into two tables at the same time? or
simply to insert into a table that'd somewhere else but accessible
through federation...if the latter is the question then wouldn't an
instead-of trigger work?
Why bother using a trigger in that case?
/Lennart
I did a quick test using a 2-phase commit federation definition and
that didn't work either. Strange, given that the InfoCenter mentions a
trigger on SQLRepl capture site updating a table usually found at the
target site:

http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=%2Fcom.ibm.swg.im.iis.db.repl.sqlrepl.doc%2Ftopics%2Fiiyrscapsetendsynchpt.html

I'd like to see this cleared out as well...

Kind regards,

Frederik
Lennart Jonsson
2012-02-08 20:20:29 UTC
Permalink
On 2012-02-08 10:22, Frederik Engelen wrote:
[...]
Post by Frederik Engelen
I did a quick test using a 2-phase commit federation definition and
that didn't work either.
Ah, ok. I was not even aware that one could define federation that way.
I'll have a look at that

/Lennart

[...]
m***@gmail.com
2018-05-03 23:07:36 UTC
Permalink
Post by Bruno Almeida
Hello all,
DB2 v9.5 fixpack 5 LUW.
I need insert values on a federated table using a trigger.
Is that possible?
SQL30090N Operation invalid for application execution environment.
Reason
code = "22". LINE NUMBER=8. SQLSTATE=25000
Is there another way to do this?
Regards,
Bruno
Read this:
https://www.ibm.com/support/knowledgecenter/SSEPGG_9.5.0/com.ibm.swg.im.iis.fed.query.doc/topics/cfpwrktr.html

Clearly say:
You can include SELECT statements on nicknames in the trigger body. You cannot include INSERT, UPDATE, or DELETE statements on nicknames in the trigger body

Sorry!!!

Continue reading on narkive:
Search results for 'Trigger insert data through federated table' (Questions and Answers)
7
replies
MySQL - What is it?
started 2006-07-04 04:14:24 UTC
programming & design
Loading...