Question about temporary tables - empty data?
Hello, I need to create temporary tables, but using the statement "create temporary table AS select XXX WITH DATA" results in an empty table; ==== sql>CREATE TABLE table1 (a INTEGER); operation successful (1.320ms) sql>INSERT INTO table1 VALUES(1); 1 affected row (0.693ms) sql>INSERT INTO table1 VALUES(2); 1 affected row (0.511ms) sql> sql>CREATE TEMPORARY TABLE temp1 AS SELECT * FROM table1 WITH DATA ; operation successful (0.735ms) sql>SELECT * FROM temp1; +---+ | a | +===+ +---+ 0 tuples (1.032ms) === Whereas if I don't use "temporary" for the table creation, it works fine: === sql>CREATE TABLE temp2 AS SELECT * FROM table1 WITH DATA ; operation successful (1.842ms) sql>SELECT * FROM temp2; +------+ | a | +======+ | 1 | | 2 | +------+ 2 tuples (1.898ms) === The example above is contrived, but I need to create two temporary tables to facilitate a join. Does the "temporary" keyword have different meaning than in other databases ? I couldn't find a good explanation in the on-line documentation... I'm using MonetDB v11.14.0, compiled from source with revision 45564:14983b3e103e . Thanks, -gordon _______________________________________________ users-list mailing list users-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/users-list
Solved, Assaf Gordon wrote, On 09/29/2012 11:31 AM:
I need to create temporary tables, but using the statement "create temporary table AS select XXX WITH DATA" results in an empty table;
Found this: http://osdir.com/ml/db.monetdb.devel/2007-09/msg00052.html So either adding "start transaction" or "on commit preserve rows" takes care of it. -gordon _______________________________________________ users-list mailing list users-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/users-list
On 01-10-2012 10:53:41 -0400, Assaf Gordon wrote:
Solved,
Assaf Gordon wrote, On 09/29/2012 11:31 AM:
I need to create temporary tables, but using the statement "create temporary table AS select XXX WITH DATA" results in an empty table;
Found this: http://osdir.com/ml/db.monetdb.devel/2007-09/msg00052.html
So either adding "start transaction" or "on commit preserve rows" takes care of it.
Oh cool, thanks for following up on this. Fabian _______________________________________________ users-list mailing list users-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/users-list
participants (2)
-
Assaf Gordon
-
Fabian Groffen