On Thu, Apr 16, 2009 at 5:27 AM, Baiju M <[email protected]> wrote:
> Hi,
>    I want to use sequence object support provide by Oracle with Storm.
> I found an API to support it and implemented in PostgreSQL backed.
>
> The API is like this:
>
>  id = Int(primary=True, default=Sequence("person_seq"))
>
> I just added this to Oracle backend (based on PostgreSQL backend):
>
> @compile.when(Sequence)
> def compile_sequence_oracle(compile, sequence, state):
>  return "%s.NEXTVAL" % sequence.name
>
> And I got the sequence working.
>
> Now how can we ignore this "default sequence" from other backends.
> So, that I can use the same schema with two (or more) backends.
> Currently I want use this with MS SQL.

Given that Oracle seems to support an "INSERT ... RETURNING ..."
statement, it'd probably be better to try and get that working.  That
would handle all server allocated values (sequences, triggers, etc)
with only a single query.  We prefer it for PostgreSQL over the
nextval(sequence) stuff for the same reasons.

James.

-- 
storm mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/storm

Reply via email to