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