Amer Neely wrote:
Daniel Kasak wrote:
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.


OK, that makes sense. As far as I know, my connection is still live - I don't do a disconnect anywhere. So I'm still not sure why I can't pull the data back out. I do get an error telling me about a problem with my statement near .... which is where it tries to execute the FROM command. My apologies, I'm not on the computer that I am developing this script on, so can't give you the exact error.

I'm naming the table from a purchase order number, and as far as I can tell, the table I try to read from is the same as the one I created - but I get nothing out of it.



--
Amer Neely
w: www.softouch.on.ca/
b: www.softouch.on.ca/blog/
Perl | MySQL programming for all data entry forms.
"We make web sites work!"

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to