English 中文(简体)
Script stops working on HSQLDB 1.9.0-rc6
原标题:
  • 时间:2009-11-20 21:19:41
  •  标签:
  • hsqldb

DROP VIEW V1 IF EXISTS;
DROP TABLE T1 IF EXISTS;

CREATE TABLE T1 (id INT, name VARCHAR(32), age int);
CREATE VIEW V1 AS (SELECT * FROM T1 WHERE age < 21);


I have no problem to execute the SQL statement above in one JDBC statement or on the SWING Manager from HSQLDB. Now it stops working on 1.9.0-rc6. This is error message I got - "user lacks privilege or object not found: T1 / Error Code: -5501 / State: 42501"

Does anyone know what have changed in 1.9.0-XX which made it not working?

Thanks

问题回答

In HSQLDB 1.9, it has changed to compile entire script instead of interpreting it line by line, so CREATE VIEW v1 will throw an error of not seeing T1 available.

The script has to be broken into 2 executions - first create table, then create view.


DROP TABLE T1 IF EXISTS;
CREATE TABLE T1 (id INT, name varchar(32));
INSERT INTO T1 VALUES(0, Eric );
INSERT INTO T1 VALUES(0, Tom );

The sql above will not work in one single JDBC statement anymore in 1.9.0-rc.





相关问题
HSQLDB how to manually insert records

My question is how can I manually add records to hsqldb database. I mean using command line or some client. I know I can use hsqldb manager but I cannot execute any query with it. It says that there ...

Hibernate/JPA/HSQLDB Enum issues

I am using Hibernate annotations and entity manager (JPA) with HSQLDB. So I have an entity with an enum field: @Enumerated(EnumType.STRING) @Column(name = "access_level") public AccessLevel ...

Converting Oracle date arithmetic to work in HSQLDB

I m trying to spot-test an Oracle backed database with hsqldb and dbunit, but I ve run into a snag. The problem is with the following EJB-QL (simplified a bit): SELECT o FROM Offer o WHERE :...

Storing UUID in HSQLDB database

I wish to store UUIDs created using java.util.UUID in a HSQLDB database. The obvious option is to simply store them as strings (in the code they will probably just be treated as such), i.e. varchar(...

Migrate Grail s HSQLDB embedded database

how to migrate Grail s HSQLDB embedded database(That contains my App s Data that I don t want to lose) into external one, such as MySQL or ApacheDerby?

Script stops working on HSQLDB 1.9.0-rc6

DROP VIEW V1 IF EXISTS; DROP TABLE T1 IF EXISTS; CREATE TABLE T1 (id INT, name VARCHAR(32), age int); CREATE VIEW V1 AS (SELECT * FROM T1 WHERE age < 21); I have no problem to execute the SQL ...

热门标签