Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Hi,
I have a table with clients and a sequid, in this sequid I will put
the id of the sequence that corresponds to the client:
CREATE TABLE client(
name CHAR(20),
sequid INT REFERECES syssequences(sequid)
)
Every time there is an insert on this table I will create a sequence
with the same name as client.name and put the sequence sequid in
client.sequid. My question is: In a SQL procedure, how can I obtain
the NEXT VALUE for each sequence?
Something like this would be perfect:
SELECT NEXTVAL INTO m_nextval FROM syssequences WHERE sequid=3
but this doesn't work. Is there any way to call the nextval function
other than with sequence_name.nextval?
Thanks,
Gonzalo
Your privacy choices
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.