Amer Neely wrote:
I'm writing a perl script in which I need to save some session data.
My first attempt is to use a temporary table to store some data.
However, I'm a little unclear as to the lifespan of the temporary
table. My understanding is they last until the session ends, or a
DELETE TABLE is issued. My question is 'what is a session'?
For example, in my perl script I create and populate the table in one
subroutine, but need to access it from another in the same script. But
it doesn't appear to live through the transition from one subroutine
to another.
Anyone have an idea whether this can even be done, or does calling
another subroutine end the 'session', thus killing the table?
Session isn't exactly the right word for it. The temporary tables hang
around for the lifetime of the database connection. So if you open a
database connection, make a tmp table, close the DB connection, and open
another one ( inside the same subroutine ), your tmp table will be gone.
Also, if you open 2 DB connections, and make a tmp table from one, the
other connection can't see it. So just keep your DB connection ( or
database handle in Perl speak ) live and you should be able to see the
table.
--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: [EMAIL PROTECTED]
website: http://www.nusconsulting.com.au
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]