dbTalk Databases Forums  

setting currval in a sequence without recreating the sequence

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss setting currval in a sequence without recreating the sequence in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
seannakasone
 
Posts: n/a

Default setting currval in a sequence without recreating the sequence - 07-10-2008 , 01:55 PM






Can you set the currval in a sequence without having to drop and recreate
the sequence? I rather not have to drop and recreate something because I
have to do a lot more paperwork. Can't we just use alter or update?
please provide example.

Reply With Quote
  #2  
Old   
Malcolm Dew-Jones
 
Posts: n/a

Default Re: setting currval in a sequence without recreating the sequence - 07-10-2008 , 04:47 PM






seannakasone (snakason (AT) pgsnakason (DOT) hawaiianelectric.net) wrote:
: Can you set the currval in a sequence without having to drop and recreate
: the sequence? I rather not have to drop and recreate something because I
: have to do a lot more paperwork. Can't we just use alter or update?
: please provide example.

Loop over nextval until you get to the number you want (assuming you
want a higher number).

Reply With Quote
  #3  
Old   
Malcolm Dew-Jones
 
Posts: n/a

Default Re: setting currval in a sequence without recreating the sequence - 07-10-2008 , 04:47 PM



seannakasone (snakason (AT) pgsnakason (DOT) hawaiianelectric.net) wrote:
: Can you set the currval in a sequence without having to drop and recreate
: the sequence? I rather not have to drop and recreate something because I
: have to do a lot more paperwork. Can't we just use alter or update?
: please provide example.

Loop over nextval until you get to the number you want (assuming you
want a higher number).

Reply With Quote
  #4  
Old   
Malcolm Dew-Jones
 
Posts: n/a

Default Re: setting currval in a sequence without recreating the sequence - 07-10-2008 , 04:47 PM



seannakasone (snakason (AT) pgsnakason (DOT) hawaiianelectric.net) wrote:
: Can you set the currval in a sequence without having to drop and recreate
: the sequence? I rather not have to drop and recreate something because I
: have to do a lot more paperwork. Can't we just use alter or update?
: please provide example.

Loop over nextval until you get to the number you want (assuming you
want a higher number).

Reply With Quote
  #5  
Old   
Malcolm Dew-Jones
 
Posts: n/a

Default Re: setting currval in a sequence without recreating the sequence - 07-10-2008 , 04:47 PM



seannakasone (snakason (AT) pgsnakason (DOT) hawaiianelectric.net) wrote:
: Can you set the currval in a sequence without having to drop and recreate
: the sequence? I rather not have to drop and recreate something because I
: have to do a lot more paperwork. Can't we just use alter or update?
: please provide example.

Loop over nextval until you get to the number you want (assuming you
want a higher number).

Reply With Quote
  #6  
Old   
DA Morgan
 
Posts: n/a

Default Re: setting currval in a sequence without recreating the sequence - 07-10-2008 , 05:16 PM



seannakasone wrote:
Quote:
Can you set the currval in a sequence without having to drop and recreate
the sequence? I rather not have to drop and recreate something because I
have to do a lot more paperwork. Can't we just use alter or update?
please provide example.
No. And CURRVAL does not exist in a sequence ... ever. CURRVAL exists
within a session following a NEXTVAL call.
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
  #7  
Old   
DA Morgan
 
Posts: n/a

Default Re: setting currval in a sequence without recreating the sequence - 07-10-2008 , 05:16 PM



seannakasone wrote:
Quote:
Can you set the currval in a sequence without having to drop and recreate
the sequence? I rather not have to drop and recreate something because I
have to do a lot more paperwork. Can't we just use alter or update?
please provide example.
No. And CURRVAL does not exist in a sequence ... ever. CURRVAL exists
within a session following a NEXTVAL call.
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
  #8  
Old   
DA Morgan
 
Posts: n/a

Default Re: setting currval in a sequence without recreating the sequence - 07-10-2008 , 05:16 PM



seannakasone wrote:
Quote:
Can you set the currval in a sequence without having to drop and recreate
the sequence? I rather not have to drop and recreate something because I
have to do a lot more paperwork. Can't we just use alter or update?
please provide example.
No. And CURRVAL does not exist in a sequence ... ever. CURRVAL exists
within a session following a NEXTVAL call.
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
  #9  
Old   
DA Morgan
 
Posts: n/a

Default Re: setting currval in a sequence without recreating the sequence - 07-10-2008 , 05:16 PM



seannakasone wrote:
Quote:
Can you set the currval in a sequence without having to drop and recreate
the sequence? I rather not have to drop and recreate something because I
have to do a lot more paperwork. Can't we just use alter or update?
please provide example.
No. And CURRVAL does not exist in a sequence ... ever. CURRVAL exists
within a session following a NEXTVAL call.
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
  #10  
Old   
joel garry
 
Posts: n/a

Default Re: setting currval in a sequence without recreating the sequence - 07-10-2008 , 07:02 PM



On Jul 10, 11:55*am, seannakasone
<snaka... (AT) pgsnakason (DOT) hawaiianelectric.net> wrote:
Quote:
Can you set the currval in a sequence without having to drop and recreate
the sequence? *I rather not have to drop and recreate something becauseI
have to do a lot more paperwork. *Can't we just use alter or update?
please provide example.
Can't we all just google along?

http://www.oracle.com/technology/ora...03/110903.html
http://www.oracle.com/technology/ora...04/010404.html
http://www.arikaplan.com/oracle/ari90298.html

Of course, that stuff is really old, so whether or not it works on
current Oracle versions needs to be tested.

jg
--
@home.com is bogus.
http://www.sfgate.com/columnists/car...degreens.shtml


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.