Solved

Issue with using "for xml"

Posted on 2011-02-15
5
443 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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 demonstrates probably the easiest way to configure domain-wide tier isolation within Active Directory. If you do not know tier isolation read https://technet.microsoft.com/en-us/windows-server-docs/security/securing-privileged-access/s…
After-hours service is a fact of life for most MSPs. While not the most pleasant aspect of the job, there are ways to make after-hours servicing a more profitable and organized enterprise.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

680 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