Satya
Satya

Reputation: 2124

Tree structure data in HSQLDB

In my project, I need to maintain data in tree hierarchy.

Below code is something which I can do in Oracle.

Can the same be done in HSQLDB?

create table corporate_slaves ( slave_id integer primary key, supervisor_id references corporate_slaves, name varchar(100) );

If I use the same code, I get "Unexpected token: REFERENCES, error code: -5581" in HSQLDB.

Can anyone suggest how to build this kind of table?

Regards,

Satya

Upvotes: 0

Views: 234

Answers (1)

Lev Khomich
Lev Khomich

Reputation: 2247

create table corporate_slaves (
  slave_id integer primary key,
  supervisor_id integer,
  name varchar(100),
  foreign key (supervisor_id) references corporate_slaves(slave_id)
);

Upvotes: 1

Related Questions