-->
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.  [ 3 posts ] 
Author Message
 Post subject: How to use ORACLE Sequence just for number generation ???
PostPosted: Mon Jan 29, 2007 10:05 am 
Beginner
Beginner

Joined: Fri Oct 06, 2006 7:11 am
Posts: 32
Hi all,

I have a requirement that I have to generate a number for a certificate that I am creating. This number will be prefixed with the current year eg. 07/00001
and will be reset each year.

I was wondering if there is any way I can create an oracle sequence that I can use to simply get the next_val each time I need to and then I can recreate the sequence programatically at the start of each new year.

I don't want to have a table that is used by the sequence as I wouldn't be able to reset the sequence programatically each year.

Anyone have any ideas or can point me in the right direction.

Thanks for any help.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 29, 2007 7:13 pm 
Expert
Expert

Joined: Tue Dec 28, 2004 7:02 am
Posts: 573
Location: Toulouse, France
Well, I guess you're gonna need to implement something of your own doing some native SQL to retrieve/create/drop the right sequence when needed. I don't think you'll find something already done in Hibernate that will let you do it magicly :-).

_________________
Baptiste
PS : please don't forget to give credits below if you found this answer useful :)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 30, 2007 6:16 am 
Beginner
Beginner

Joined: Fri Oct 06, 2006 7:11 am
Posts: 32
Yeah, I think you are right. Think I might have another way of doing it as well.

thanks for the reply.


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

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.