cancel
Showing results for 
Search instead for 
Did you mean: 

Does MaxDB supports temporary tables

Former Member
0 Kudos

By definition "A TEMPORARY table is visible only to the current connection, and is dropped automatically when the connection is closed.This means that two different connections can use the same temporary table name without conflicting with each other or with an existing non-TEMPORARY table of the same name."

This is what is mentioned about temporary tables in MySQL 5.0 Ref Manual.

Now the question is, does MaxDB supports creation of these kind of tables ? If yes what's the syntax?

Regards

Raja

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

just do

CREATE TABLE TEMP.<tablename> ...

Elke

Former Member
0 Kudos

Hi Elke,

I'll try that out. i am not a database expert but from whatever little i know mostly the convention temp.<table name> is used in context of temp being the tablespace name. So, let me try it out first.

Regards

Raj

Former Member
0 Kudos

Hi Elke,

Following are the test steps i did and reached to the conclusion that your suggestion is the solution for this problem. Thank you very much.

: sqlcli -u MONA,RED -d MAXDB1

:CREATE TABLE test ( name VARCHAR(100))

:CREATE TABLE temp.test ( name VARCHAR(100)) 1 - Allows creation of table test even though one already exist

sqlcli MAXDB1=> insert into temp.test values ('Raja')

1 row affected (1 msec)

sqlcli MAXDB1=> select * from temp.test

NAME


Raja

1 row selected (1 msec)

sqlcli MAXDB1=> select * from test

  • 0: SQLSTATE:

sqlcli MAXDB1=> exit

i056063: sqlcli -u MONA,RED -d MAXDB1

Welcome to the MaxDB interactive terminal.

Type: \h for help with commands

\q to quit

sqlcli=>

sqlcli MAXDB1=> select * from temp.test

  • -4004: POS(15) Unknown table name:TEST SQLSTATE: 42000

  • -4004: POS(15) Unknown table name:TEST SQLSTATE: 42000 3- when we exit from that session and relogin, info about temp.test is not there anymore.

sqlcli MAXDB1=> select * from test

  • 0: SQLSTATE:

Thank you very much

Raja

Answers (0)