Solved

Issue with using "for xml"

Posted on 2011-02-15
5
435 Views
Last Modified: 2012-05-11
Hi,
I am using ASE version 15.0.3/EBF 17769 ESD#4/P/Sun_svr4/OS 5.8/ase1503/2768/64-bit.
Recently a functionality was deployed to audit data changes to come key application tables using for xml. The trigger code is as follows:

CREATE TRIGGER tr_XXX ON t_XXX  FOR INSERT, UPDATE, DELETE  
AS
IF @@rowcount = 0 /* no rows deleted */ return
declare @tablename varchar(32)
select @tablename = 't_XXX' INSERT INTO t_Audit_XXX
SELECT @tablename, (select * from deleted for xml),  (select * from inserted for xml),  getdate(), suser_name(), host_name()
IF @@error != 0
BEGIN
PRINT 'An error occurred backing up deleted row'
ROLLBACK TRAN
END
RETURN

The issue is that in some sporadic cases, deletes/inserts in the table t_XXX might fail the trigger execution stating: error 208 : t_XXX not found.
The same statements would then work fine if fired from a different session. In order to make the statment work on the same session, either the trigger has to be dropped or disabled.  Its very difficult to replicate the issue, but in rare cases we have been able to get the same issue across multiple session/macs. Sometimes recompiling the trigger works, in other cases it doesn't.
So not exactly sure what is going wrong here. Has any one else faced this issue? Please advise.
0
Comment
Question by:PrandipBora
5 Comments
 

Expert Comment

by:rachmanesha
ID: 34903570
Need help with docgen? [Document generation software] is loaded with stuff to help make the most of docgen. Very good suggestions on how to optimize a docgen system.
0
 
LVL 13

Accepted Solution

by:
alpmoon earned 500 total points
ID: 34909413
It looks weird. Have you tried Sybase tech support? It might be a known bug and they might be able to help.
0
 

Author Comment

by:PrandipBora
ID: 34913322
Thanks aplmoon. I am raising a case with Sybase now. Can't think of anything else.
0
 
LVL 29

Expert Comment

by:leonstryker
ID: 35510894
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Is your company's data protection keeping pace with virtualization? Here are 7 dynamic ways to adapt to rapid breakthroughs in technology.
Find out what the Office 365 disclaimer function is, why you would use it and its limited ability to create Office 365 signatures.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

747 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now