Author |
Message
|
amateur10 |
Posted: Thu Dec 15, 2005 12:40 pm Post subject: Tirgger for inserting data into event table |
|
|
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 |
|
 |
recallsunny |
Posted: Thu Dec 15, 2005 1:04 pm Post subject: |
|
|
 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 |
|
 |
amateur10 |
Posted: Thu Dec 15, 2005 1:33 pm Post subject: |
|
|
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 |
|
 |
recallsunny |
Posted: Thu Dec 15, 2005 1:42 pm Post subject: |
|
|
 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 |
|
 |
amateur10 |
Posted: Thu Dec 15, 2005 1:48 pm Post subject: |
|
|
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 |
|
 |
amateur10 |
Posted: Fri Dec 16, 2005 6:29 am Post subject: |
|
|
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 |
|
 |
recallsunny |
Posted: Fri Dec 16, 2005 10:31 am Post subject: |
|
|
 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 |
|
 |
amateur10 |
Posted: Fri Dec 16, 2005 10:59 am Post subject: |
|
|
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 |
|
 |
vennela |
Posted: Fri Dec 16, 2005 12:23 pm Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
|
Back to top |
|
 |
|