Forum OpenACS Q&A: Response to Sequence.nextval error

Collapse
Posted by Dan Wickstrom on
select nextval('sequence') is the format that postgresql expects.  If you look more closely at the instances where we use sequence.nextval in tcl, the calling routines do a regsub on sequence.nextval and convert it to nextval('sequence') before passing it to the postgresql driver.  This is just a shortcut to save us from having to port all of those nexval statements.

You can fake the oracle syntax using a view:

create sequence sequence_name_t start 1;

create view sequence_name as
select nextval('sequence_name_t') as nextval;