Solved

BCP and Triggers

Posted on 2002-06-21
3
1,214 Views
Last Modified: 2008-03-04
Hello All,
  The Scenario:  Two tables, A and B.  One trigger T, a row inserted into table A will get the trigger T to fire to automatically insert some values into B.  I have no trouble getting the trigger to fire when performing an SQL to insert something into table A.  The problem is with BCP.  Trigger never fired when I loaded data into table A via the BCP utility.  Is this something that Sybase support or am I out of luck?

Also, in Oracle, triggers can be fired after or before a transaction is taken place.  Can I do the same thing in Sybase and how?

Thanks.
0
Comment
Question by:johnchan2000
3 Comments
 

Accepted Solution

by:
sunpatil earned 100 total points
ID: 7100139
In sybase when u do bcp triggers don't get fired.
In sybase there is no before or after trigger concept.

regards

sunpatil
0
 
LVL 5

Expert Comment

by:amitpagarwal
ID: 7102723
it is actually simple to achieve.

1. bcp in the data into a different table with same schema ( say XY)
2. then insert into the actual table
insert into maintable select * from XY

This will fire the triggers.

Thanks.
0
 
LVL 1

Author Comment

by:johnchan2000
ID: 7104216
sunpatil answered both of my questions and amitpagarwal gave me an idea on how to get around the problem.  Both gave good and acceptable answers.  sunpatil gets the points since he gave the answers first.

Thanks folks.
0

Featured Post

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question