[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Issue with using "for xml"

Posted on 2011-02-15
5
Medium Priority
?
452 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 2000 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

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
It’s time for spooky stories and consuming way too much sugar, including the many treats we’ve whipped for you in the world of tech. Check it out!
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

650 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