Thomas,

Thanks for the fix.  There seems to be a similar issue with the
following syntax:

     select last_value from conf.report_id_seq

This is also likely a PostgreSQL-specific syntax.

org.springframework.jdbc.UncategorizedSQLException: Hibernate
operation: could not execute query; uncategorized SQLException for SQL
[select last_value from conf.report_id_seq]; SQL state [90079]; error
code [90079]; Schema CONF not found; SQL statement:
select last_value from conf.report_id_seq [90079-102]; nested
exception is org.h2.jdbc.JdbcSQLException: Schema CONF not found; SQL
statement:
select last_value from conf.report_id_seq [90079-102]
Caused by: org.h2.jdbc.JdbcSQLException: Schema CONF not found; SQL statement:
select last_value from conf.report_id_seq [90079-102]
        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.command.Parser.getSchema(Parser.java:596)
        at org.h2.command.Parser.readTableOrView(Parser.java:4203)
        at org.h2.command.Parser.readTableFilter(Parser.java:967)
        at org.h2.command.Parser.parseSelectSimpleFromPart(Parser.java:1496)
        at org.h2.command.Parser.parseSelectSimple(Parser.java:1593)
        at org.h2.command.Parser.parseSelectSub(Parser.java:1490)
        at org.h2.command.Parser.parseSelectUnion(Parser.java:1335)
        at org.h2.command.Parser.parseSelect(Parser.java:1323)
        at org.h2.command.Parser.parsePrepared(Parser.java:392)
        at org.h2.command.Parser.parse(Parser.java:288)
        at org.h2.command.Parser.parse(Parser.java:260)
        at org.h2.command.Parser.prepareCommand(Parser.java:232)
        at org.h2.engine.Session.prepareLocal(Session.java:352)
        at org.h2.engine.Session.prepareCommand(Session.java:313)
        at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1042)
        at 
org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:72)
        at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:219)
        at 
org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:497)
        at 
org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:415)
        at 
org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
        at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1538)
        at org.hibernate.loader.Loader.doQuery(Loader.java:661)
        at 
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
        at org.hibernate.loader.Loader.doList(Loader.java:2211)
        at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2095)
        at org.hibernate.loader.Loader.list(Loader.java:2090)
        at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:289)
        at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1695)
        at 
org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142)
        at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:152)
        at 
org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:811)
        at 
com.example.ips.report.data.dao.hibernate.conf.ReportConfHibernate$8.doInHibernate(ReportConfHibernate.java:239)
        at 
org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:372)
        at 
org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:338)
        at 
com.example.ips.report.data.dao.hibernate.conf.ReportConfHibernate.getLastReportId(ReportConfHibernate.java:233)
        at 
com.example.ips.report.data.dao.conf.ReportConfDaoTest.getLastReportId(ReportConfDaoTest.java:74)




On Mon, Oct 27, 2008 at 5:02 PM, Thomas Mueller
<[EMAIL PROTECTED]> wrote:
>
> Hi,
>
>> That new syntax does the trick, thanks.  I notice that the case seems
>> to matter.
>
> Yes, this syntax is case sensitive. The regular nextval('...') is not
> however (and will not be).
>
>> The case
>> does not seem to matter in "create sequence" or "create schema".
>
> That's because the database converts unquoted names to uppercase. See also:
>
> http://www.h2database.com/html/grammar.html#name
> http://www.h2database.com/html/grammar.html#quotedname
>
>> I confess ignorance as to how this should actually work in standard SQL,
>> but it is a surprise.
>
> As far as I know, H2 works like defined by the SQL standard. Other
> databases work differently.
>
>> I work out of svn, so I'll keep an eye out for that fix.
>
> It is now in the SVN.
>
> Regards,
> Thomas
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to