insert into... select... duplicate key

2005-09-24 Thread Schimmel LCpl Robert B \(GCE 2nd Intel Bn Web Master\)
Here is the problem that I am having. I am trying to make a copy of a full record in a table that has a primary key with auto-increment. The real problem is that I want the statement to use SELECT * so that if columns ever get added to the table the statement will still work for the full record. I

How to change table character set

2005-09-24 Thread MightyData
I have a database that was created with MySQL 4.0. The character set for each table is latin1. I have upgraded the server to MySQL 4.1. I would like to change the character set for each table to utf8. What is the correct procedure? Can I just change the table character set with an alter statement o

Creating HUGE reports

2005-09-24 Thread Miguel Cardenas
Hello... After solving some problems with the code, now am working with the real one database. On my tests was playing with 20,000 records and worked pretty fine sorting by X or Y field and setting some 'where ...' conditions. At this moment the database has 250,000+ records, new insertions are

myhostname-bin.000nn @ /usr/local/mysql/var

2005-09-24 Thread Miguel Cardenas
Hello list I wanted to know how much space was using the database am working on, but found some big files I don't know what they do... these files are located in /usr/local/mysql/var and are named 'myhostname-bin.000nn' (nn is 1 to 29 at this moment)... I don't know that are those files, so

Re: A Complicated Report

2005-09-24 Thread Peter Brawley
Shaun, >We have a database that keeps track of days worked and days taken off by >staff. All days worked / taken off are held in a table called Bookings. >Staff work on Projects and each project will have various Work_Types, days >taken off are not related to projects and are held in >Unavailab

Re: Using ifnull in a subquery

2005-09-24 Thread Jonathan Mangin
- Original Message - From: "Jonathan Mangin" <[EMAIL PROTECTED]> To: Sent: Saturday, September 24, 2005 2:18 PM Subject: Using ifnull in a subquery Hello all, This works if t2 is populated: select t1.item_no, t1.value1 * (select weight from t2 where item_no = t1.item_no and descri

Using ifnull in a subquery

2005-09-24 Thread Jonathan Mangin
Hello all, This works if t2 is populated: select t1.item_no, t1.value1 * (select weight from t2 where item_no = t1.item_no and descrip = 'dime bag') from t1 where t1.descrip = 'marigold seeds' If t1.item_no and/or 'dime bag' don't exist in t2 I'd like to multiply by a different value (5): sele

Re: foreign keys in MyISAM?

2005-09-24 Thread Martijn Tonies
> I don't know the date you're asking about. However, you can > implement the FKs' features using stored procedures in MySQL 5.0. > For a small example have a look at the nice article about stored > procedures: > http://dev.mysql.com/tech-resources/articles/mysql-storedprocedures.html > Hmmm... gi

Re: daemon crash when shutting down large databases

2005-09-24 Thread Gleb Paharenko
Hello. > = 77591546 K Really - something is wrong with your memory settings - MySQL is using about 77G of memory (or you have such a cool server :)! Please send the output of 'SHOW VARIABLES' statement, 'SHOW STATUS' statement and your configuration file. Include the amount of physica

Re: foreign keys in MyISAM?

2005-09-24 Thread Gleb Paharenko
Hello. I don't know the date you're asking about. However, you can implement the FKs' features using stored procedures in MySQL 5.0. For a small example have a look at the nice article about stored procedures: http://dev.mysql.com/tech-resources/articles/mysql-storedprocedures.html

Re: Multithread handling of Connect/Close

2005-09-24 Thread Lefteris Tsintjelis
Pooly wrote: Hi, 2005/9/24, Lefteris Tsintjelis <[EMAIL PROTECTED]>: Sujay Koduri wrote: I think mysql does not allow multiple threads to act on the same connection. You have to create a connection pool and pick one for each thread You can use one connection for all your thread. Just b

Re: Multithread handling of Connect/Close

2005-09-24 Thread Pooly
Hi, 2005/9/24, Lefteris Tsintjelis <[EMAIL PROTECTED]>: > Sujay Koduri wrote: > > > I think mysql does not allow multiple threads to act on the same connection. > > You have to create a connection pool and pick one for each thread > You can use one connection for all your thread. Just be sure to

RE: Multithread handling of Connect/Close

2005-09-24 Thread Sujay Koduri
http://dev.mysql.com/doc/mysql/en/c-thread-functions.html Have a look at this. Also if you are compiling it using the pthread library, you can directly use the functions provided by ptherad library. And you need not to do the forking also. This sample code might give you an understanding.. Int h

Re: Multithread handling of Connect/Close

2005-09-24 Thread Lefteris Tsintjelis
Sujay Koduri wrote: I think mysql does not allow multiple threads to act on the same connection. You have to create a connection pool and pick one for each thread Either that or keep handling them on a per thread basis but do I have to also do mysql_server_init/end on a per child then, or just

Multithread handling of Connect/Close

2005-09-24 Thread Sujay Koduri
I think mysql does not allow multiple threads to act on the same connection. You have to create a connection pool and pick one for each thread sujay -Original Message- From: Lefteris Tsintjelis [mailto:[EMAIL PROTECTED] Sent: Saturday, September 24, 2005 4:39 PM To: mysql@lists.mysql.

Multithread handling of Connect/Close

2005-09-24 Thread Lefteris Tsintjelis
Hi, In case I compile with -lpthread, can I just simply take out of the loop the MySQLConnect/MySQLClose and run over the same connection multiple threads? Are there any other changes required to handle multi threading? Is there any --enable-thread-safe example? Thnx again, Lef

A Complicated Report

2005-09-24 Thread Shaun
Hi, We have a database that keeps track of days worked and days taken off by staff. All days worked / taken off are held in a table called Bookings. Staff work on Projects and each project will have various Work_Types, days taken off are not related to projects and are held in Unavailability_D

Re: Must mysql_free_result be called after mysql_store_result in case of NULL?

2005-09-24 Thread Lefteris Tsintjelis
Pooly wrote: 2005/9/24, Lefteris Tsintjelis <[EMAIL PROTECTED]>: Hi, I have been searching for this for a while without finding a good answer. In the following example, MUST I call mysql_free_result() in case mysql_store_result(sql)==NULL or not? Is the following valid in case of NULL? quer

Re: insert subquery

2005-09-24 Thread Pooly
2005/9/23, Gordon Bruce <[EMAIL PROTECTED]>: > What am I missing > > INSERT INTO table1 (column names.) > SELECT VALUES.. > FROM table2 > WHERE primary id = insert value > > You will have to put in your real table name and column names. > nice and easy :-) -- Pooly Webzine Rock : http://w

Re: Must mysql_free_result be called after mysql_store_result in case of NULL?

2005-09-24 Thread Pooly
2005/9/24, Lefteris Tsintjelis <[EMAIL PROTECTED]>: > Hi, > > I have been searching for this for a while without finding a > good answer. > > In the following example, MUST I call mysql_free_result() in > case mysql_store_result(sql)==NULL or not? > > Is the following valid in case of NULL? > > que