How do I invoke a postgresql sequence while inserting new row into a table?
I want to do something like this:
insert into biz_term(
biz_term_id,
biz_term_name,
)
values(SELECT nextval(idsequence)',
'temp'
);
I want to do it because when I am trying to insert new record into biz_term table then sequence idsequence is not getting invoked directly. How to invoke it?
You got it almost. You don’t need the SELECT in there:
Any reasons you did not specify the biz_term_id as
serial(orbigserial) which handles that automatically for you?