db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonas Pettersson <jlpetters...@gmail.com>
Subject How to SELECT data from in-memory Derby database table?
Date Fri, 11 Nov 2011 12:39:23 GMT
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

Mime
View raw message