sql - HSQLDB table not found using script to create table and insert data -
i using gui (hsqldb.jar) in hsqldb 2.2.9 create db. have sql commands in separate text file. create db, copy text , paste hsqldb editor , hit "execute sql" button. have created db several times different revisions, each time executing create table commands 1 press of "execute sql" button, , insert into commands subsequent press of "execute sql" button. works, more convenient execute both create , insert commands @ same time. i've tried combine these 1 "execute sql", keep getting error:
user lacks privilege or object not found: shop / error code: -5501 / state: 42501
here's i've tried:
create table shop ( id int not null identity, name varchar(255) not null, unique (name) ) insert shop values ( null, 'test shop' ) note exact same code works if execute sql in 2 separate steps. i've tried putting commit between create , insert commands, checkpoint, neither of these solved problem. tried adding set write_delay false @ top, didn't solve either.
what need add code make work in 1 step? thanks!
this not possible.
the gui client sends text in window database engine. engine compiles statements before executing them. because of this, if statement relies on completion of previous statement, won't compile.
the better way populate database script sqlfile tool part of sqltool.jar. tool executes statements 1 one.
the separate guide here:
Comments
Post a Comment