table sequence, renumbering

Started by J.V.over 14 years ago3 messagesgeneral
Jump to latest
#1J.V.
jvsrvcs@gmail.com

What is the absolute fastest way to populate a primary key / id column
from a named db sequence (disabled constraints and want to renumber the
primary key / id column from sequence.

cannot use auto inc or serial column because need to use generic
hibernate mapping files for multiple DB's in the end, but want a stored
proc to simple reorder a primary key int column pulling from a named
sequence, if there is a single command.

thanks

J.V.

#2Scott Marlowe
scott.marlowe@gmail.com
In reply to: J.V. (#1)
Re: table sequence, renumbering

On Tue, Oct 4, 2011 at 9:51 AM, J.V. <jvsrvcs@gmail.com> wrote:

What is the absolute fastest way to populate a primary key / id column from
a named db sequence (disabled constraints and want to renumber the primary
key / id column from sequence.

cannot use auto inc or serial column because need to use generic hibernate
mapping files for multiple DB's in the end, but want a stored proc to simple
reorder a primary key int column pulling from a named sequence, if there is
a single command.

Not even temporary sequences to do the just the renumbering?

In reply to: J.V. (#1)
Re: table sequence, renumbering

On 04/10/2011 16:51, J.V. wrote:

What is the absolute fastest way to populate a primary key / id column
from a named db sequence (disabled constraints and want to renumber the
primary key / id column from sequence.

cannot use auto inc or serial column because need to use generic
hibernate mapping files for multiple DB's in the end, but want a stored
proc to simple reorder a primary key int column pulling from a named
sequence, if there is a single command.

Something like this? -

update my_table set my_column = nextval('my_sequence');

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie