ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Interchange Server + Adapters » Tirgger for inserting data into event table

Post new topic  Reply to topic
 Tirgger for inserting data into event table « View previous topic :: View next topic » 
Author Message
amateur10
PostPosted: Thu Dec 15, 2005 12:40 pm    Post subject: Tirgger for inserting data into event table Reply with quote

Centurion

Joined: 23 Nov 2005
Posts: 102

I succeed to connect to the outbound connector as jdbc connector. Now, I am trying jdbc as inbound as well. I successfully configured the connector, but when insert the record in the input table, which shuould trigger inserting datainto event table I could not fix it. Can some one give some ideas?

thanks guys
Back to top
View user's profile Send private message
recallsunny
PostPosted: Thu Dec 15, 2005 1:04 pm    Post subject: Reply with quote

Disciple

Joined: 15 Jun 2005
Posts: 163
Location: Massachusetts

Code:

CREATE TRIGGER [trigger name] ON [table name]
FOR [Your EventType Insert/update/delete]
AS
DECLARE @EventId int, @Count Decimal(20)
SELECT @EventId=SomeId FROM INSERTED
EXECUTE insert_event_f2 ConnectorId, @EventId, 'Your BO name', 'Your Verb', EventPriority, @Count


Keep going
Back to top
View user's profile Send private message
amateur10
PostPosted: Thu Dec 15, 2005 1:33 pm    Post subject: Reply with quote

Centurion

Joined: 23 Nov 2005
Posts: 102

Let say my table and bo name is JDBCASBO then


CREATE TRIGGER JDBCASBO_INS_TRIG1 ON JDBCASBO
FOR INSERT
AS
I understnad that but not the remaining. Is there any place in icshelp webite I can understand it
or can you give as an example.

Thanks
Back to top
View user's profile Send private message
recallsunny
PostPosted: Thu Dec 15, 2005 1:42 pm    Post subject: Reply with quote

Disciple

Joined: 15 Jun 2005
Posts: 163
Location: Massachusetts

I suggest reading more about creating triggers using SQL and examining "insert_event_f" stored proc in the connector dependencies folder
Back to top
View user's profile Send private message
amateur10
PostPosted: Thu Dec 15, 2005 1:48 pm    Post subject: Reply with quote

Centurion

Joined: 23 Nov 2005
Posts: 102

Okey. I will do that. Can you give me idea that the trigger has to do. Such as when a record is inserset into the input table, it has to insert a record in event table, but does it also need to delete that record or should we creae another trigger for that? the record in event table should be transferred into archive as I understand. do we need another grigger? it would be real helpful if you can gime me that concept.

thanks
Back to top
View user's profile Send private message
amateur10
PostPosted: Fri Dec 16, 2005 6:29 am    Post subject: Reply with quote

Centurion

Joined: 23 Nov 2005
Posts: 102

Hey guys,

I was able to insert records once in input table and it worked. but next time it does not work.

when implement the script to insert a record into the input table, it gives sql error.

can someone give me some idea about what should be happened when the record is inserted and besides the trigger to watch insertion, should there any a procedure or whatever, to delete record from event table and insert into archive table?
pls help. I could not get idea from reading

thanks
Back to top
View user's profile Send private message
recallsunny
PostPosted: Fri Dec 16, 2005 10:31 am    Post subject: Reply with quote

Disciple

Joined: 15 Jun 2005
Posts: 163
Location: Massachusetts

Are you trying to insert the same event again (with the same Ids/keys)? If this is the case, then you need to delete the archived events from the archive table which stores event ids that are already processed by the connector. In general, use the primary/unique keys of the table as event id's to avoid duplicate events.

Secondly, you don't need anyother process to archive the events from Event table, its handled by the default connector behaviour.
Back to top
View user's profile Send private message
amateur10
PostPosted: Fri Dec 16, 2005 10:59 am    Post subject: Reply with quote

Centurion

Joined: 23 Nov 2005
Posts: 102

Thanks you very much for reply. your point is that the event_id for event table should be uniq of the input table. that means

the trigger at one point will have


values(uniq_key_of_the_input_table, ..........)

is that true?


thanks once more
Back to top
View user's profile Send private message
vennela
PostPosted: Fri Dec 16, 2005 12:23 pm    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

Correct
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Interchange Server + Adapters » Tirgger for inserting data into event table
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.