Re: Temporary Tables
Thanks! Mamatha From: Paul DuBois [EMAIL PROTECTED] To: Mamatha Balasubramanian [EMAIL PROTECTED],[EMAIL PROTECTED] Subject: Re: Temporary Tables Date: Tue, 4 Mar 2003 17:31:36 -0600 At 23:19 + 3/4/03, Mamatha Balasubramanian wrote: Thank you once again. I have a web-interface that does search on a given text and I would have a script that creates a temporary table. So according to you, in my script, I just to need create a temporary table and not have to worry about another client using the same web interface (and thereby using the same program). Can you please elaborate a little more on this? Sure. You are incorrect. :-) That is, you're making an assumption that cannot necessarily be made. If you can guarantee that the web script will establish a new connection, and the connection will terminate when the script ends, you can indeed do what you describe above. But you *cannot* do that if you're running your script in an environment that uses persistent connections that may be used by successive instances of the script. PHP persistent connections fall into this class, for example. Several requests might be served by the same instance of the web server process, and you don't know that one request won't be getting the connection used by a previous request. In that case, the connection won't have closed, and the TEMPORARY table won't have disappeared. You can guard against this by issuing this query before creating the TEMPORARY table: DROP TABLE IF EXISTS tbl_name Thanks, Mamatha From: Paul DuBois [EMAIL PROTECTED] To: Mamatha Balasubramanian [EMAIL PROTECTED],[EMAIL PROTECTED] Subject: Re: Temporary Tables Date: Tue, 4 Mar 2003 17:06:30 -0600 At 23:00 + 3/4/03, Mamatha Balasubramanian wrote: Hi, I would like to know how MySQL handles multiple temporary tables? 1. Can multiple temporary tables be created at the same time? 2. If so, how does MySQL differentiate them - do we need to explicitly give them different names inorder to identify them or does MySQL provide a timestamp (or use some other means) to identify the tables? You can create multiple temporary tables, but they must have different names. A TEMPORARY table can have the same name as a non-TEMPORARY table. The non-TEMPORARY table is hidden to the client that creates the TEMPORARY table as long as the TEMPORARY table exists. A second TEMPORARY table with the same name cannot be created. This is on a connection-specific basis. Two clients each can create a TEMPORARY table with the same name. Only the table created by a given client is visible to that client. I use MySQL 4.0.7 on Red Hat. Thanks, Mamatha _ The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Temporary Tables
Hi, I would like to know how MySQL handles multiple temporary tables? 1. Can multiple temporary tables be created at the same time? 2. If so, how does MySQL differentiate them - do we need to explicitly give them different names inorder to identify them or does MySQL provide a timestamp (or use some other means) to identify the tables? I use MySQL 4.0.7 on Red Hat. Thanks, Mamatha _ The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Temporary Tables
Thank you once again. I have a web-interface that does search on a given text and I would have a script that creates a temporary table. So according to you, in my script, I just to need create a temporary table and not have to worry about another client using the same web interface (and thereby using the same program). Can you please elaborate a little more on this? Thanks, Mamatha From: Paul DuBois [EMAIL PROTECTED] To: Mamatha Balasubramanian [EMAIL PROTECTED],[EMAIL PROTECTED] Subject: Re: Temporary Tables Date: Tue, 4 Mar 2003 17:06:30 -0600 At 23:00 + 3/4/03, Mamatha Balasubramanian wrote: Hi, I would like to know how MySQL handles multiple temporary tables? 1. Can multiple temporary tables be created at the same time? 2. If so, how does MySQL differentiate them - do we need to explicitly give them different names inorder to identify them or does MySQL provide a timestamp (or use some other means) to identify the tables? You can create multiple temporary tables, but they must have different names. A TEMPORARY table can have the same name as a non-TEMPORARY table. The non-TEMPORARY table is hidden to the client that creates the TEMPORARY table as long as the TEMPORARY table exists. A second TEMPORARY table with the same name cannot be created. This is on a connection-specific basis. Two clients each can create a TEMPORARY table with the same name. Only the table created by a given client is visible to that client. I use MySQL 4.0.7 on Red Hat. Thanks, Mamatha - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Loading data
When I try to use mysqlimport DatabaseName tablename.txt from command line, it doesn't work. However, if I use the following command from mysql prompt mysqlload data local infile /home//tablename.txt into table tablename.txt it works. Can anyone tell me how I can load data from the command line? Thank you. _ MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Can't load data using mysqlimport
When I tried loading data using the following command from command line: mysqlimport DatabaseName tablename.txt I got the following error: mysqlimport: error : can't get stat of /home/./tablename.txt However, when I used the following command from mysql prompt, I was able to load the data without any problem. mysqlload data local infile /home//tablename.txt into table tablename.txt I use MySQL 4.0.7 on Red Hat Linux. Can anyone tell me why I have the above problem with mysqlimport and how I can fix it? Thanks. _ MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Can't load data using mysqlimport
Thanks a lot for your help. It works! From: Paul DuBois [EMAIL PROTECTED] To: Mamatha Balasubramanian [EMAIL PROTECTED],[EMAIL PROTECTED] Subject: Re: Can't load data using mysqlimport Date: Fri, 21 Feb 2003 16:32:31 -0600 At 22:14 + 2/21/03, Mamatha Balasubramanian wrote: When I tried loading data using the following command from command line: mysqlimport DatabaseName tablename.txt I got the following error: mysqlimport: error : can't get stat of /home/./tablename.txt However, when I used the following command from mysql prompt, I was able to load the data without any problem. mysqlload data local infile /home//tablename.txt into table tablename.txt I use MySQL 4.0.7 on Red Hat Linux. Can anyone tell me why I have the above problem with mysqlimport and how I can fix it? With LOAD DATA you specified LOCAL. With mysqlimport, you didn't specify --local. As a result, it's the server that's trying to read the file on the server host. The server may not have permission to read the file. Run mysqlimport with the --local option. Thanks. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php _ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php