-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: stored procedure using temp table - sybase
PostPosted: Fri Dec 02, 2005 2:04 pm 
Newbie

Joined: Fri Apr 01, 2005 8:45 pm
Posts: 17
Strange problem. I have a stored procedure that selects a few values into a temp table and then uses that temp table to delete some rows from another table:

SELECT id into #mytemp FROM tableA WHERE id=@id

DELETE from tableB WHERE id in
(select id from #mytemp)

the proc works fine when I run it from my database client. But when I use session.connection() to get the raw JDBC connection and run:

CallableStatement cs = c.prepareCall("{ call del_proc(?) }");
cs.setInt(1, id);
cs.execute();

I get no error, no exception, but the proc doesn't work. i.e. nothing gets deleted. Is this a transaction issue with the temp table?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.