Solved

Issue with using "for xml"

Posted on 2011-02-15
5
447 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
Not everyone has adapted to a rapid advancement in technology; there are people who are reluctant or afraid to delve into this brave new world of IT. If you have a friend or a family member who suffers from the so-called technophobia, here is how yo…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

739 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