Hi,
This is an incompatibility with PostgreSQL. I will fix that in the
next release. A workaround is to use:
select nextval('CONF', 'REPORT_ID_SEQ');
Unfortunately this is not supported by PostgreSQL.
Regards,
Thomas
On Sat, Oct 25, 2008 at 4:24 AM, Limbic System <[EMAIL PROTECTED]> wrote:
>
> If I create a sequence inside a schema I can't seem to "find" it:
>
>
> public static void main(String[] args) throws Exception {
> String jdbcUrl =
> "jdbc:h2:mem:;MODE=PostgreSQL;DB_CLOSE_DELAY=-1;TRACE_LEVEL_SYSTEM_OUT=4";
> String driver = "org.h2.Driver";
>
> Class.forName(driver);
> Connection conn = DriverManager.getConnection(jdbcUrl, "DBA", "");
> Statement st = conn.createStatement();
> st.executeUpdate("drop schema conf if exists; create schema conf;");
> st.executeUpdate("create sequence conf.report_id_seq;");
> st.executeQuery("select nextval('conf.report_id_seq');");
> }
>
>
> Exception in thread "main" org.h2.jdbc.JdbcSQLException: Sequence
> CONF.REPORT_ID_SEQ not found; SQL statement:
> select nextval('conf.report_id_seq'); [90036-101]
> at org.h2.message.Message.getSQLException(Message.java:103)
> at org.h2.message.Message.getSQLException(Message.java:114)
> at org.h2.message.Message.getSQLException(Message.java:77)
> at org.h2.schema.Schema.getSequence(Schema.java:423)
> at org.h2.expression.Function.getSequence(Function.java:1125)
> at org.h2.expression.Function.getValueWithArgs(Function.java:1025)
> at org.h2.expression.Function.getValue(Function.java:406)
> at org.h2.command.dml.Select.queryFlat(Select.java:499)
> at org.h2.command.dml.Select.queryWithoutCache(Select.java:560)
> at org.h2.command.dml.Query.query(Query.java:233)
> at org.h2.command.CommandContainer.query(CommandContainer.java:81)
> at org.h2.command.Command.executeQueryLocal(Command.java:140)
> at org.h2.command.Command.executeQuery(Command.java:121)
> at org.h2.jdbc.JdbcStatement.executeQuery(JdbcStatement.java:75)
>
>
> If I simply remove the ".conf" from the create/select, it works fine.
>
> Thanks.
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/h2-database?hl=en
-~----------~----~----~----~------~----~------~--~---