I use the derby.jar that is included in JDK7. I have created an
in-memory database table with Derby using:

DECLARE GLOBAL TEMPORARY TABLE SESSION.memtable (id int, name
varchar(10)) NOT LOGGED

I can INSERT data to the table with:

INSERT INTO SESSION.memtable (id, name) VALUES (?,?)

and it returns "1 rows affected".

But how can I SELECT data from this table?

I have tried:

SELECT name FROM SESSION.memtable WHERE id = ?

and

SELECT t1.name AS name FROM SESSION.memtable t1 WHERE id = ?

but both these queries return an empty result set.

How can I SELECT data from my in-memory Derby database table?

I have also posted this question with full code listing on
StackOverflow: 
http://stackoverflow.com/questions/8093368/how-to-select-data-from-in-memory-derby-database-table

/Jonas

Reply via email to