views:

41

answers:

1

hello, how do I create and manipulate information temporarily spacial? and codify so as not to overwrite and to be used in a web application.

thanks for answers

+1  A: 

I use 2 strategies:

  1. Create table with session_id column filed which maps to your web application session, it is used for "simple" informations which are general. Remove this info when web session is finished or after some time.
  2. Create table with name that you know it will be temporary (prefix it with something like temp_), then create "master" table with info about which session use such table. When session is destroyed you will have to drop those tables, or drop it after some time. I use this strategy for more specialized cases. In this case you will have to remember "temp" table name in session data.

I do not use true TEMP tables because it will not work with database connection pooling I use.

Michał Niklas