[Users] Is there any command in ingres to set the value of
Sequence
Ajay Dalvi
dalvi_ajay at extenprise.net
Thu Feb 23 22:52:21 PST 2006
Hi,
Lets say sequence definition for mysequence is:
create sequence mysequence as integer
start with 1 increment by 1
minvalue 1 maxvalue 99999999
cache 1 cycle no order
\p\g
Now if I use ALTER SEQUENCE command as follows
alter sequence mysequence restart with 12 \p\g
The after execution of the alter sequence command , if we see the
definition of sequence,
by using
help sequence mysequence \g
it will show:
create sequence mysequence as integer
start with 12 increment by 1
minvalue 1 maxvalue 99999999
cache 1 cycle no order
\p\g
What I actually want is the behaviour same as if we execute following
command 12 times
select next value for mysequence \g
In case of Postgresql database this behaviour we get by using
command:
select pg_catalog.setval('mysequence', 12, false);
This will set the value of sequence mysequence to 12.
-Ajay
On Fri, 2006-02-24 at 11:58, Karl & Betty Schendel wrote:
> At 11:46 AM +0530 2/24/2006, Ajay Dalvi wrote:
> >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.
>
> I don't understand. You want to change the sequence without changing
> the sequence? I'm not clear on what you are trying to achieve here.
> Perhaps you could explain what real life problem you are trying
> to solve, that ALTER SEQUENCE doesn't solve.
>
> Karl
> _______________________________________________
> Users mailing list
> Users at ingres.ca.com
> http://ingres.ca.com/mailman/listinfo/users
--
This message has been scanned for viruses and
dangerous content by Extenprise mailscanner, and is
believed to be clean.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ingres.com/pipermail/users/attachments/20060224/945881d1/attachment.html
More information about the Users
mailing list