-
Trigger help
Hi ALL,
I have a question regarding trigger
I have a Procedure that is inserting records into 10 tables
When this procedure is inserting into my table
I need to check the Column name in my table Status = 'ACTIVE'
But my trigger is not calling the procedure its just checking the status before inserting into table
If status is Active then allow to insert records into table
Else
null
Thanks for your help
Thanks
-
Hi All ,
This is wHat i need
This is What I need exactly
HI ALL,
I have table called Payment
ID NAME STATUS AMOUNT
---- ------ ------ --------
1 A ACTIVE 1000
2 B INACTIVE 1000
3 C ACTIVE 1000
4 D INACTIVE 1000
Some Other developer is having a procedure that inserting values into my table
when he tries to insert records into my table for example
ID NAME STATUS AMOUNT
---- ------ ------ --------
1 A ACTIVE 3000
2 B INACTIVE 3000
3 C ACTIVE 3000
4 D INACTIVE 3000
My before insert trigger has to check my table first the Staus = 'ACTIVE' records
I have Name A,B are ACTIVE records in my table
WHat it hase to do is Just insert A,C values from procedure into my table and Delete the OLD records of A,C beacuse the initail it was ACTIVE records
and Not allow to insert Name B,D Because the status original was Inactive in my table
NOTE :
I need to check the ACTIVE Status of Existing records and Allow only those records and not allow
ANy Trigger code is help ful
Thanks for you rhelp
-
Use a view of this table and create a instead of trigger to implement it.
But still why cant you do it from the procedure where you are inserting.
HTH
-dharma
-
Help
HI Why I am not controlling in procedure is
Not even in procedure if some one try to insert records into table directly or using the procedure i need to stop them doing so
ANy code is helpful
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|