Go Back   Rhinocerus > Newsgroup > Newsgroup comp.databases.* > Newsgroup comp.databases.ibm-db2

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 01-26-2012, 03:03 PM
Bruno Almeida
Guest
 
Posts: n/a
Default Trigger insert data through federated table

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
Reply With Quote
Alt Today
Advertising
 
and become member of Rhinocerus
Standard Sponsored Links

  #2 (permalink)  
Old 01-26-2012, 05:44 PM
Lennart Jonsson
Guest
 
Posts: n/a
Default Re: Trigger insert data through federated table

On 2012-01-26 17:03, Bruno Almeida wrote:
> 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

>
> 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?


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

Reply With Quote
  #3 (permalink)  
Old 01-26-2012, 06:02 PM
Helmut Tessarek
Guest
 
Posts: n/a
Default Re: Trigger insert data through federated table

> 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
Reply With Quote
  #4 (permalink)  
Old 01-27-2012, 09:02 PM
Lennart Jonsson
Guest
 
Posts: n/a
Default Re: Trigger insert data through federated table

On 2012-01-26 20:02, Helmut Tessarek wrote:
>> No, you can't update both systems within the same transaction

>
> What about 2-phase commit?
>


Helmut, not sure I understand. The question was:

> > I need insert values on a federated table using a trigger.
> >
> > Is that possible?


and my answer was:

> No, you can't update both systems within the same transaction


how could a two-phase commit be applied here?


/Lennart

Reply With Quote
  #5 (permalink)  
Old 02-03-2012, 01:20 PM
Bruce
Guest
 
Posts: n/a
Default Re: Trigger insert data through federated table

On Jan 27, 5:02*pm, Lennart Jonsson <erik.lennart.jons...@gmail.com>
wrote:
> On 2012-01-26 20:02, Helmut Tessarek wrote:
>
> >> No, you can't update both systems within the same transaction

>
> > What about 2-phase commit?

>
> Helmut, not sure I understand. The question was:
>
> > > I need insert values on a federated table using a trigger.

>
> > > Is that possible?

>
> and my answer was:
>
> > 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?
Reply With Quote
  #6 (permalink)  
Old 02-07-2012, 07:19 PM
Lennart Jonsson
Guest
 
Posts: n/a
Default Re: Trigger insert data through federated table

On 2012-02-03 15:20, Bruce wrote:
[...]
> 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
Reply With Quote
  #7 (permalink)  
Old 02-08-2012, 08:22 AM
Frederik Engelen
Guest
 
Posts: n/a
Default Re: Trigger insert data through federated table

On Feb 7, 9:19*pm, Lennart Jonsson <erik.lennart.jons...@gmail.com>
wrote:
> On 2012-02-03 15:20, Bruce wrote:
> [...]
>
> > 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/infoce...ndsynchpt.html

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

Kind regards,

Frederik

Reply With Quote
  #8 (permalink)  
Old 02-08-2012, 07:20 PM
Lennart Jonsson
Guest
 
Posts: n/a
Default Re: Trigger insert data through federated table

On 2012-02-08 10:22, Frederik Engelen wrote:
[...]
>
> 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

[...]


Reply With Quote
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT. The time now is 04:50 AM.


Copyright ©2009

LinkBacks Enabled by vBSEO 3.3.0 RC2 © 2009, Crawlability, Inc.