Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / Ingres Topics / February 2006

Tip: Looking for answers? Try searching our database.

[Info-ingres] Is there any command in ingres to set the value of Sequence

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ajay Dalvi - 24 Feb 2006 06:16 GMT
HI all,
       In case of sequence in ingres, is there any command available to
set the value of the sequence to some value.

For e.g.  Lets sequence name is "mysequence"
Then in case of postgresql we can set the value of a sequence to say
value 12,  as follows:

       SELECT pg_catalog.setval('mysequence', 12, false);

So can we have same behaviour in ingres?

There is ALTER SEQUENCE Command available in ingres that  has restart
clause.
But this command changes the actual definition of sequence.

So is there any command in ingres through which we can set the value of
sequence to some value?

-Ajay

Signature

This message has been scanned for viruses and
dangerous content by Extenprise mailscanner, and is
believed to be clean.

weaselboy1976 - 24 Feb 2006 13:45 GMT
Try this:
alter sequence mysequence restart with 12
Roy Hann - 24 Feb 2006 14:29 GMT
> Try this:
> alter sequence mysequence restart with 12

I've been following this thread on another forum and the OP is actually
trying to do something a bit different.  What he wants to do is restore a
database from a static copy, then manually tweak it up to some specific
later state not captured in the backup.  I am extremely wary of the intent
behind that, and I am no friend of sequences to begin with, but just because
I am bored by what I'm really supposed to be doing just now, here's a
solution:

If the sequence is an integer sequence, do this:

sql dbname +Y
update iisequence
set seq_next_int = 12
where seq_name = 'whatever' and seq_owner='whoever'
\g
\q

If it's a decimal sequence replace seq_next_int by seq_next_dec.

Roy
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.