find the next id in database
843859Apr 11 2006 — edited Apr 11 2006Hi I am creating a simple table like this (and dropping/creating schema before hand so my tests work correctly):
drop schema books cascade;
create schema books;
create sequence books.entity_id_sequence;
create table books.book(id bigint DEFAULT nextval('books.entity_id_sequence') primary key,
title varchar(256));
However when I use "executeUpdate" in my code like this -
int m = executeUpdate("INSERT INTO books.book VALUES(0,'Some books title')");
I don't know how to specify the next available id value I have just stuck a zero in there. How do you find the next available id value from the database?