473,395 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

DROP TEMP TABLES

Jay
Hey there,
I have a question. Is it possible to to construct something through
a combination of php and javascript that (when a browser window is
closed) would drop temp tables that are used? I've tried to use an
override of the SESSION functions, but that isn't working in the way I
would like it to. I go into mysql and can see that the temp tables that
were created for the user are still in the database. Also, I would have
liked to have used mysql's temp tables, but those tables don't seem to
be maintained across different pages in one session. When a user goes
from one page to another, those temp tables are gone. Any suggestions?

-Jay
(patel at cs dot utk dot edu)

Oct 14 '05 #1
5 2833
Jay said the following on 14/10/2005 14:57:
Hey there,
I have a question. Is it possible to to construct something through
a combination of php and javascript that (when a browser window is
closed)
No.
would drop temp tables that are used? I've tried to use an
override of the SESSION functions, but that isn't working in the way I
would like it to. I go into mysql and can see that the temp tables that
were created for the user are still in the database. Also, I would have
liked to have used mysql's temp tables, but those tables don't seem to
be maintained across different pages in one session. When a user goes
from one page to another, those temp tables are gone. Any suggestions?


Temporary tables are exactly that - temporary. They are designed to be
used for a short period of time, e.g. within one SQL transaction.

If you require data for longer periods of time, you should re-think your
data structure/processing.

What sort of information are you using your temp tables for?

--
Oli
Oct 15 '05 #2
Oli Filth wrote:
Jay said the following on 14/10/2005 14:57:
Hey there,
I have a question. Is it possible to to construct something through
a combination of php and javascript that (when a browser window is
closed)


No.
would drop temp tables that are used? I've tried to use an
override of the SESSION functions, but that isn't working in the way I
would like it to.
Stick at it - this is the only way to solve the problem.
from one page to another, those temp tables are gone. Any suggestions?


Temporary tables are exactly that - temporary. They are designed to be
used for a short period of time, e.g. within one SQL transaction.


Erm, bad terminology - they last one MySQL *session* i.e. between
mysql_connect() and mysql_close() (or end of script).

But as Oli says - are you *really* sure you need a temporary table?

C.
Oct 15 '05 #3
"Jay" <pa***@cs.utk.edu> writes:
Hey there,
I have a question. Is it possible to to construct something through
a combination of php and javascript that (when a browser window is
closed) would drop temp tables that are used? I've tried to use an


Sure. You need a php script that will take an arg that tells it what
table to drop.

Call this script in a JS onClose event. Have the page that loads as a
result of this close itself instantly with an onClose in the onLoad
event.

Security and all the fine details of this left as your exercise.

And of course, this isn't going to be totally reliable since not
everyone has JS enabled.

May I suggest you abandon this silliness and timestamp your temporary
tables and drop them with an hourly (or whatever) batch process?

Or what about using a trigger or rule on the insert to the timestamp
table that tries to drop old tables whenever a new one is created.
HTH
--
-------------------------------------------------------------------------------
Jerry Sievers 305 854-3001 (home) WWW ECommerce Consultant
305 321-1144 (mobile http://www.JerrySievers.com/
Oct 15 '05 #4
Oli Filth <ca***@olifilth.co.uk> writes:
Temporary tables are exactly that - temporary. They are designed to be
used for a short period of time, e.g. within one SQL transaction.


Perhaps. This may depend on what DB you're using.

In Postgres (7.4.1) temp tables have the lifetime of a backend session
unless dropped explicitly.

Within transactions, the temp table will exist after the transaction
if same is commited, but disappear on a rollback. (as we might
expect).

HTH

--
-------------------------------------------------------------------------------
Jerry Sievers 305 854-3001 (home) WWW ECommerce Consultant
305 321-1144 (mobile http://www.JerrySievers.com/
Oct 15 '05 #5
"" wrote:
Hey there,
I have a question. Is it possible to to construct
something through
a combination of php and javascript that (when a browser
window is
closed) would drop temp tables that are used? I've tried to
use an
override of the SESSION functions, but that isn't working in
the way I
would like it to. I go into mysql and can see that the temp
tables that
were created for the user are still in the database. Also, I
would have
liked to have used mysql's temp tables, but those tables don't
seem to
be maintained across different pages in one session. When a
user goes
from one page to another, those temp tables are gone. Any
suggestions?

-Jay
(patel at cs dot utk dot edu)


Your particular need can also be addressed by caching data, which
expires after a set period of time. Look into cache lite. Easy to
use and setup.

--
Posted using the http://www.dbforumz.com interface, at author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.dbforumz.com/DROP-TEMP-TA...ict263550.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbforumz.com/eform.php?p=909026

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Oct 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ryan | last post by:
Just a quicky about temporarary tables. If using QA, when you create a temporary table, it gets dropped if you close the query. Otherwise you need to state 'DROP TABLE myTable' so that you can...
1
by: Radu | last post by:
Hi. Thru a sproc, I drop & re-create some temp tables. When I call that sproc from the client, though, I cannot drop the tables. I need to allow the user, say "Alex", to drop/create tables...
1
by: ezra epstein | last post by:
I found a post about something similar in an older release: http://archives.postgresql.org/pgsql-bugs/2002-08/msg00151.php Here's the issue. Inside a function I'm calling CREATE LOCAL TEMPORARY...
2
by: robert | last post by:
the real DBAs aren't around for a few days, so rather than shoot myself in a tender spot, i thought i'd ask first. what docs i can find say that the syntax is: DROP TABLESPACE FOO seems...
14
by: deko | last post by:
Can the DROP TABLE statement be used with a select or where statement? DROP TABLE SELECT * FROM tblTablesImported WHERE Import_ID Not In (SELECT FROM tblTablesInternal); Or do I have to...
2
by: Yoshitha | last post by:
hi I have 2 drop down lists in my application.1st list ontains itmes like java,jsp,swings,vb.net etc.2nd list contains percentage i.e it conatains the items like 50,60,70,80,90,100. i will...
1
by: Robin Tucker | last post by:
Apologies for the ambiguous title, you will be expecting me to be asking how to perform drag and drop from my application into another application. Well, kind-of. I've got drag and drop sorted,...
0
by: mjohnson0321 | last post by:
I am trying to incorporate a CSS drop-down menu into a site (suckerfish menu). The menu gets lost behind the content below it, but only on one of the drop downs (News). The error occurs on all of...
10
by: Dean | last post by:
My client has a db I am working that uses temp tables. During an update procedure, I had the code If fTableExists(tempTblName) = True Then DoCmd.DeleteObject acTable, tempTblName Then I thought...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.