RE: Action after new/update record

2005-01-26 Thread Jay Blanchard
[snip] I'm quite new with mySQL, i have bought the book Mastering MySQL4 but i don'f find a solution for my problem there. There are no triggers in version 4 if 'im correct, but i want to export a table (small one) every time there is a new record or a record modified. Whats the way to do this,

RE: Insert if Update failed without Select

2005-01-17 Thread Logan, David (SST - Adelaide)
Hi, Try using the DBI-trace(2) method. This will print a lot of stuff on your screen however it shows the UPDATE after it has bound all the variables etc. You will see the statement as it will be passed to the database. This has saved me a lot of work recently in showing up bugs very quickly

Update does not doing updates

2005-01-16 Thread sam wun
Hi, I use the following statement to update a table, but I don't see the testing record being updated: $udpate_sql = qq {update transaction set salesvolume=$salesvol, netsales=$netsales, transtype=$transtype, returnreason=$returnreason

Re: Insert if Update failed without Select

2005-01-16 Thread beacker
Please also note hat UPDATE returns the number of records updated. If your UPDATE returns 0, you know that the record does not exist, and you might want to INSERT instead. There is one situation where the number of records updated will return 0, yet the row exists. If you update the record

Re: Insert if Update failed without Select

2005-01-16 Thread sam wun
[EMAIL PROTECTED] wrote: Please also note hat UPDATE returns the number of records updated. If your UPDATE returns 0, you know that the record does not exist, and you might want to INSERT instead. There is one situation where the number of records updated will return 0, yet the row exists

Insert if Update failed without Select

2005-01-15 Thread sam wun
Hi, Without using Select statement, how can I execute Insert SQL statement if Update action is failed? I may be asking for too much. If Select statemnet have to be used to determine the existence of a recordset, what is an efficient way to execute Insert if Update is failed? I m using MySQL 5.0

Re: Insert if Update failed without Select

2005-01-15 Thread Mattias J
At 2005-01-15 14:48, you wrote: Without using Select statement, how can I execute Insert SQL statement if Update action is failed? I may be asking for too much. If Select statemnet have to be used to determine the existence of a recordset, what is an efficient way to execute Insert if Update

Re: Insert if Update failed without Select

2005-01-15 Thread Mattias J
Please also note hat UPDATE returns the number of records updated. If your UPDATE returns 0, you know that the record does not exist, and you might want to INSERT instead. At 2005-01-15 14:54, you wrote: At 2005-01-15 14:48, you wrote: Without using Select statement, how can I execute Insert

Re: Error in Insert on Duplicate Key Update

2005-01-14 Thread Richard Whitney
Quoting sam wun [EMAIL PROTECTED]: HI, the following insert/update produced error. I m using MySQL 5.0. $insert_sql = qq {insert into inventory (prodcode,qty,lastupdatedate,prodname,basename,vendorname,cost) values (?,?,?,?,?,?,?) ON DUPLICATE KEY UPDATE

Perl Script to transform a MySql insert into an update

2005-01-14 Thread zzapper
Hi, Does anyone have a Perl Script (or other) to transform a MySql insert into an update (or vice-versa)??? zzapper (vim, cygwin, wiki zsh) -- vim -c :%s%s*%CyrnfrTfcbafbeROenzSZbbyranne%|:%s)[R-T]) )Ig|:norm G1VGg? http://www.vim.org/tips/tip.php?tip_id=305 Best of Vim Tips -- MySQL

Re: Perl Script to transform a MySql insert into an update

2005-01-14 Thread zzapper
On Fri, 14 Jan 2005 18:42:41 +, wrote: Hi, Does anyone have a Perl Script (or other) to transform a MySql insert into an update (or vice-versa)??? Just wrote a QAD (Quick and dirty) script see below, has no error handling #!perl # sedit.pl # description : Transform a mysql insert

Error in Insert on Duplicate Key Update

2005-01-13 Thread sam wun
HI, the following insert/update produced error. I m using MySQL 5.0. $insert_sql = qq {insert into inventory (prodcode,qty,lastupdatedate,prodname,basename,vendorname,cost) values (?,?,?,?,?,?,?) ON DUPLICATE KEY UPDATE qty

Re: The table '#sql_6d1b_0' is full during multitable UPDATE

2005-01-10 Thread Gleb Paharenko
Hello. You may use some recommendations from: http://dev.mysql.com/doc/mysql/en/Full_table.html Jocelyn Fournier [EMAIL PROTECTED] wrote: Hi, I've just encountered a strange problem when trying to update a table : UPDATE searchmainhardwarefr0, searchjoinhardwarefr0 SET

The table '#sql_6d1b_0' is full during multitable UPDATE

2005-01-08 Thread Jocelyn Fournier
Hi, I've just encountered a strange problem when trying to update a table : UPDATE searchmainhardwarefr0, searchjoinhardwarefr0 SET searchmainhardwarefr0.numeropost=searchjoinhardwarefr0.topic WHERE searchmainhardwarefr0.numreponse=searchjoinhardwarefr0.numreponse; ERROR 1114 (HY000): The table

Update log

2005-01-06 Thread Chenri J
i'm still using 3.23 can anyone show me how to activate update log by modifying the my.cnf/ my.ini And a question about update log, does it only record update and delete (mysql documentation), how about insert? do the log recorded those too? thanks

Re: Update log

2005-01-06 Thread Chenri J
update log by modifying the my.cnf/ my.ini And a question about update log, does it only record update and delete (mysql documentation), how about insert? do the log recorded those too? thanks __ Do you Yahoo!? The all-new My Yahoo! - What

Re: Update log

2005-01-06 Thread Roger Baklund
Chenri J wrote: i'm still using 3.23 can anyone show me how to activate update log by modifying the my.cnf/ my.ini Show you? It is not clear what you want. Do you need help starting the editor? What OS are you using? On Windows systems Notepad can be used to edit the configuration files. Which

BEGIN...nothing? (Re: Update log)

2005-01-06 Thread Roger Baklund
Chenri J wrote: one more question, how about when i'm using 'BEGIN' and doesn't end it with 'COMMIT' neither 'ROLLBACK' what will happen. I've tried before and nothing happen but does anyone have an opinion? This depends on a number of things: If the table handler in question does not support

RE: Multi table update

2005-01-03 Thread Jay Blanchard
[snip] I read 6) as saying that until you complete all of the calculations on a row, you don't change the data for the row. I could even interpret this as saying that you don't update ANY row on the table until you have completed the calculations for ALL of the rows. I read 7) as saying that you

RE: Update a Field in a table to Uppercase

2005-01-02 Thread Tom Crimmins
[snip] Does anyone have a sample of a simple update statement I can run to update a field in a table to all uppercase values. [/snip] UPDATE mytable SET mycol=UPPER(mycol); --- Tom Crimmins Interface Specialist Pottawattamie County, Iowa -- MySQL General Mailing List For list archives: http

Update a Field in a table to Uppercase

2005-01-01 Thread Alan Scott - Yahoo Acct
Does anyone have a sample of a simple update statement I can run to update a field in a table to all uppercase values. Any help or web references are appreciated.

RE: Multi table update

2004-12-31 Thread SGreen
://www.ncb.ernet.in/education/modules/dbms/SQL99/ansi-iso-9075-2-1999.pdf) ISO/IEC 9075-2:1999 (E) 14.10 update statement: searched (p 687) 9) The update source of each set clause is effectively evaluated for each row of T before any row of T is updated. 10) A set clause specifies one or more object columns

RE: Multi table update

2004-12-30 Thread Jay Blanchard
to be handled at once. I know MySQL cannot handle handle the query as one big block behind the doors, but I wonder why I / my application has to know about these internals in this case. UPDATE statements work with the JOIN order and update each table in succession. Dependent on the number of rows affected

RE: Multi table update

2004-12-30 Thread SGreen
. And everything between sending and the receiving the result I expect to be handled at once. I know MySQL cannot handle handle the query as one big block behind the doors, but I wonder why I / my application has to know about these internals in this case. UPDATE statements work with the JOIN

Re: Multi table update

2004-12-30 Thread Kai Ruhnau
[EMAIL PROTECTED] schrieb: I snipped the discussion down to the SQL-statements with some explanational text. I hope it does not break reading. [snip] UPDATE table1 INNER JOIN table2 ON table2.ID_table1=table1.ID SET table2.value=table2.value-IF(table1.condition=7,1,0), table1.condition=8

RE: Multi table update

2004-12-30 Thread Jay Blanchard
[snip] I hope I am not so naive that Kai and I are the only two who sees a problem with this behavior. Some of you may think this is a feature but I do not like it because that means that calculational errors will occur simply by inverting column positions (putting one before the other) within a

Re: Multi table update

2004-12-30 Thread Kai Ruhnau
) of multi-table updates the behavior is exactly the same as this. I don't think it is clear, what Shawn's and my point is. It is clear, that a multi table update will be executed in a serialized manner. I don't want to think of the difficulties in implementing a true atomic multi table update

RE: Multi table update

2004-12-30 Thread SGreen
? That could imply that I need to change the design of my tables so that my update statements will execute in the correct order. If only the changes had happened in the sequence specified in Kai's original SET statement... (sigh) 8-D Shawn Green Database Administrator Unimin Corporation - Spruce

RE: Multi table update

2004-12-30 Thread Jay Blanchard
[snip] So the question is not, if a multi table update should be implemented serialized. The answer is clear: yes it should. The question is, on which data the subsequent updates should work. [/snip] It should work on the data specified in the update query. Each set statement is isolated

RE: Multi table update

2004-12-30 Thread Jay Blanchard
of a SET clause? Why does the query engine seem to revert to processing changes in table column order and not maintain the statement sequence order as specified by the user? That could imply that I need to change the design of my tables so that my update statements will execute in the correct order

RE: Multi table update

2004-12-30 Thread SGreen
the design of my tables so that my update statements will execute in the correct order. If only the changes had happened in the sequence specified in Kai's original SET statement... (sigh) 8-D [/snip] It is because you are defining the order of the update in the UPDATE statement itself

RE: Multi table update

2004-12-30 Thread Jay Blanchard
[snip] ... a bunch of stuff [/snip] It alomost sounds as if you're coming from a M$ campwhat you describe are VIEWS. Anyhow, the ANSI SQL standards specify some of the behaviors we have been talking about. Many DB manufacturers use the standards and implement other features like you

RE: Multi table update

2004-12-30 Thread SGreen
to match the last update applied to it. But they don't change their values (for calculation purposes) until the engine finishes the row. Anyhow, it has been a good discussion. No bugs were uprooted and everyone's understanding may have risen a notch. After a couple of decades using SQL I

RE: Multi table update

2004-12-30 Thread Jay Blanchard
[snip] Anyhow, it has been a good discussion. No bugs were uprooted and everyone's understanding may have risen a notch. After a couple of decades using SQL I still find interesting topics to discuss. Yes, I too have enjoyed this conversation. Thank you for thinking out loud with me on such an

RE: Multi table update OT

2004-12-30 Thread Jay Blanchard
[snip] ...tons o' stuff... [/snip] BTW...Happy New Year! -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

RE: Multi table update

2004-12-29 Thread Jay Blanchard
[snip] I would be deliriously happy if someone could explain WHY these statement _should_ have different results. If I am wrong and these UPDATE statements are supposed to provide different results, I would like to learn how I became so confused over something this fundamental. Until I get

RE: Multi table update

2004-12-29 Thread Jay Blanchard
[snip] Although my question goes in that direction, it is more about why this statement does not act atomically from my applications point of view. update table2, table1 SET table2.value=table2.value-IF(table1.condition=7,1,0), table1.condition=8 WHERE table1.ID = table2.ID_table1 [/snip

Help with an UPDATE query please

2004-12-29 Thread shaun thornburgh
Hi, I am having trouble with an UPDATE query. I have three tables as defined below. My database holds data for bookings. Each booking relates to a project. Each project has many tasks, one of which is a booking. I have now added the column Task_ID to the bookings table. How can I update all

RE: Help with an UPDATE query please

2004-12-29 Thread Jay Blanchard
[snip] I am having trouble with an UPDATE query. I have three tables as defined below. My database holds data for bookings. Each booking relates to a project. Each project has many tasks, one of which is a booking. I have now added the column Task_ID to the bookings table. How can I update all

RE: Help with an UPDATE query please

2004-12-29 Thread shaun thornburgh
Sorry Jay, I am using version 3.23.54, unfortunately I am unable to supply test data but basically I need to update the Task_ID column for the Bookings table so that it is the same as the Task_ID for Tasks and the Task_Name is 'Booking' and the Bookings Project_ID is the same as the Tasks

RE: Help with an UPDATE query please

2004-12-29 Thread Jay Blanchard
[snip] I am using version 3.23.54, unfortunately I am unable to supply test data but basically I need to update the Task_ID column for the Bookings table so that it is the same as the Task_ID for Tasks and the Task_Name is 'Booking' and the Bookings Project_ID is the same as the Tasks

RE: Multi table update

2004-12-29 Thread Kai Ruhnau
Zitat von Jay Blanchard [EMAIL PROTECTED]: [snip] Although my question goes in that direction, it is more about why this statement does not act atomically from my applications point of view. update table2, table1 SET table2.value=table2.value-IF(table1.condition=7,1,0), table1

Multi table update

2004-12-28 Thread Kai Ruhnau
Sorry for duplicating this message. But I sent the other one with the wrong subject. Hi, An SQL-statement that is conceptually equal to the following caused some astonishment. UPDATE table1 LEFT JOIN table2 ON table2.ID=table2.ID_table1 SET table2.value=table2.value-IF(table1.condition=7,1,0

RE: Multi table update

2004-12-28 Thread Jay Blanchard
[snip] UPDATE table1 LEFT JOIN table2 ON table2.ID=table2.ID_table1 SET table2.value=table2.value-IF(table1.condition=7,1,0), table1.condition=8 WHERE table1.ID=$id Is this behavior correct? [/snip] In the sense that it did what was given to it in the query, yes. From http://www.mysql.com

Re: Multi table update

2004-12-28 Thread Kai Ruhnau
Zitat von [EMAIL PROTECTED]: One reason may be due to your ON condition. ON table2.ID=table2.ID_table1 You reference table 2 twice and I doubt that on the table2 table id equals id_table1 very often. Because table2 is LEFT JOINed to table1, you will only be able to update the rows

RE: Multi table update

2004-12-28 Thread SGreen
Jay Blanchard [EMAIL PROTECTED] wrote on 12/28/2004 10:21:43 AM: [snip] UPDATE table1 LEFT JOIN table2 ON table2.ID=table2.ID_table1 SET table2.value=table2.value-IF(table1.condition=7,1,0), table1.condition=8 WHERE table1.ID=$id Is this behavior correct? [/snip] In the sense

Re: Multi table update

2004-12-28 Thread SGreen
. ON table2.ID=table2.ID_table1 You reference table 2 twice and I doubt that on the table2 table id equals id_table1 very often. Because table2 is LEFT JOINed to table1, you will only be able to update the rows that match your ON condition. Again, that would mean that you have nothing

RE: Multi table update

2004-12-28 Thread Jay Blanchard
://www.mysql.com/update You are correct in your belief that 4.1.x does not support triggers and or SP. Given that, I would suggest that the OP utilize his programming language to generate these actions. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe

Re: Multi table update

2004-12-28 Thread Kai Ruhnau
INTO table1 VALUES (2,8); CREATE TABLE table2 ( ID int(10) unsigned NOT NULL default '0', ID_table1 int(10) unsigned NOT NULL default '0', value int(10) unsigned NOT NULL default '0' ) TYPE=InnoDB; INSERT INTO table2 VALUES (1,1,5); INSERT INTO table2 VALUES (2,2,2); -- And the query: UPDATE

RE: Multi table update

2004-12-28 Thread Jay Blanchard
[snip] And the query: UPDATE table1 INNER JOIN table2 ON table2.ID_table1=table1.ID SET table2.value=table2.value-IF(table1.condition=7,1,0), table1.condition=8 WHERE table1.ID IN (1,2) After that the value's in table2 are still 5 and 2. But I would expect the 5 to be a 4. [/snip

Re: Multi table update

2004-12-28 Thread SGreen
', ID_table1 int(10) unsigned NOT NULL default '0', value int(10) unsigned NOT NULL default '0' ) TYPE=InnoDB; INSERT INTO table2 VALUES (1,1,5); INSERT INTO table2 VALUES (2,2,2); -- And the query: UPDATE table1 INNER JOIN table2 ON table2.ID_table1=table1.ID SET table2.value=table2.value

RE: Multi table update

2004-12-28 Thread SGreen
Jay Blanchard [EMAIL PROTECTED] wrote on 12/28/2004 11:38:58 AM: [snip] And the query: UPDATE table1 INNER JOIN table2 ON table2.ID_table1=table1.ID SET table2.value=table2.value-IF(table1.condition=7,1,0), table1.condition=8 WHERE table1.ID IN (1,2) After that the value's

Re: Multi table update

2004-12-28 Thread Kai Ruhnau
Zitat von Jay Blanchard [snip] And the query: UPDATE table1 INNER JOIN table2 ON table2.ID_table1=table1.ID SET table2.value=table2.value-IF(table1.condition=7,1,0), table1.condition=8 WHERE table1.ID IN (1,2) After that the value's in table2 are still 5 and 2. But I would expect

Re: Relative efficiency (in terms of disk io) between REPLACE and UPDATE w/InnoDB

2004-12-16 Thread John McCaskey
Ahhh, thats very good to know. Thank you. On Wed, 2004-12-15 at 19:09 -0500, Harrison Fisk wrote: No. In InnoDB an UPDATE is done as a DELETE/INSERT internally because it is multiversioning and it has to be able to rollback in case of a problem. So the UPDATE effectively does

Relative efficiency (in terms of disk io) between REPLACE and UPDATE w/InnoDB

2004-12-15 Thread John McCaskey
I'm currently doing a large number of REPLACE queries, I know that these evaluate as if doing a DELETE/INSERT pair, and I'm wondering if this is true on a disk io level as well with extra io occuring for the delete, and then re-insertion, vs what would occur with an UPDATE. The way it works

Re: Relative efficiency (in terms of disk io) between REPLACE and UPDATE w/InnoDB

2004-12-15 Thread John McCaskey
, and then re-insertion, vs what would occur with an UPDATE. The way it works roughly each row gets updated around 12-24 times, the updated do not affect the primary key, or any of the other keys for that matter. The table is INNODB. So I'm thinking if the row is deleted then re-inserted

Re: Relative efficiency (in terms of disk io) between REPLACE and UPDATE w/InnoDB

2004-12-15 Thread Harrison Fisk
if this is true on a disk io level as well with extra io occuring for the delete, and then re-insertion, vs what would occur with an UPDATE. The way it works roughly each row gets updated around 12-24 times, the updated do not affect the primary key, or any of the other keys for that matter. The table

Re: Relative efficiency (in terms of disk io) between REPLACE and UPDATE w/InnoDB

2004-12-15 Thread gerald_clark
John McCaskey wrote: I'm currently doing a large number of REPLACE queries, I know that these evaluate as if doing a DELETE/INSERT pair, and I'm wondering if this is true on a disk io level as well with extra io occuring for the delete, and then re-insertion, vs what would occur with an UPDATE

Delete or Update on Import

2004-12-15 Thread Tim McDonough
Once each day I have a PHP application that reads a legacy dBase format file and updates a customer table in a MySQL database. The PHP script reads each dBase record, searches for it in the table, updates the field values if they have changed, or creates a new record in the MySQL database if one

update a row in a table from another row within the same table

2004-12-12 Thread cellino
(not all) from the example row into the new customer's row within the same table. I thought, that this is easily done using UPDATE ... SELECT ..., but after failing and searching quite a bit I found the last line in the UPDATE-syntax documentation saying: Currently, you cannot update a table and select

update a row in a table from another row within the same table

2004-12-12 Thread cellino
columns (not all) from the example row into the new customer's row within the same table. I thought, that this is easily done using UPDATE ... SELECT ..., but after failing and searching quite a bit I found the last line in the UPDATE-syntax documentation saying: Currently, you cannot update a table

Re: Replication update bug/error/problem.

2004-12-08 Thread Jay Ess
(that is, the one selected by USE) is db_name. To specify more than one database, use this option multiple times, once for each database. Note that this will not replicate cross-database statements such as UPDATE some_db.some_table SET foo='bar' while having selected a different database or no database

Re: Replication update bug/error/problem.

2004-12-08 Thread Ware Adams
On Dec 8, 2004, at 9:12 AM, Jay Ess wrote: I am not using cross database updates. It is all on one database but the update uses two tables. The query update content_review_site as a,site_rating_factors as b set a.overall_rating = 77 where a.content_id=243 is a stripped down version of a bigger

Replication update bug/error/problem.

2004-12-07 Thread Jay Ess
I have a problem with an update query not replicating through to the slave. The query is update content_review_site as a,site_rating_factors as b set a.overall_rating = 77 where a.content_id=243 Version : 4.0.22 OS : Linux X86 How to replicate the error. CREATE TABLE content_review_site

Re: Replication update bug/error/problem.

2004-12-07 Thread Eric Bergen
selected by USE) is db_name. To specify more than one database, use this option multiple times, once for each database. Note that this will not replicate cross-database statements such as UPDATE some_db.some_table SET foo='bar' while having selected a different database or no database URL:http

RE: Serious error in update Mysql 4.1.7

2004-12-03 Thread SciBit MySQL Team
-Original Message- From: Luciano Pulvirenti [EMAIL PROTECTED] To: [EMAIL PROTECTED] [EMAIL PROTECTED] CC: Subject: Serious error in update Mysql 4.1.7 Sent: Fri, 03 Dec 2004 08:18:05 GMT Received: Fri, 03 Dec 2004 08:22:55 GMT Read: Fri, 03 Dec 2004 09:24:15 GMT I am trying Mysql

Re: Update optimization...

2004-12-03 Thread Gleb Paharenko
Hello. Did you read all promptings at: http://dev.mysql.com/doc/mysql/en/Full_table.html Manish [EMAIL PROTECTED] wrote: I am trying to execute this query and it is failing with Table is full error (I know I can make temp tables big). update t1, t2 set t1.XXX=1 where t1.YYY=t2

Update optimization...

2004-12-02 Thread Manish
I am trying to execute this query and it is failing with Table is full error (I know I can make temp tables big). update t1, t2 set t1.XXX=1 where t1.YYY=t2. and t2. like '%X%'; My t1 has 10,00,000+ records and t2 has about 70,000 records. I would like to know how can I optimize

Re: update and concat

2004-12-01 Thread Thomas McDonough
, but doesn't. We cannot guess what's wrong. Please enter your command, UPDATE listings SET map = CONCAT(ML, '.png') WHERE ML ''; get your error message, and then copy/paste the whole thing into your next message. That way, someone should spot the problem. Michael Thomas McDonough wrote: That did

Re: update and concat

2004-12-01 Thread Michael Stassen
enter your command, UPDATE listings SET map = CONCAT(ML, '.png') WHERE ML ''; get your error message, and then copy/paste the whole thing into your next message. That way, someone should spot the problem. Michael Thomas McDonough wrote: That did not do it. I'm still getting the same error

update and concat

2004-11-30 Thread Thomas McDonough
I'm trying to set all the values of column 'map' to the value of column ML and '.png'. My intuition and an extensive reading of the manual and mail archives tell me to do it like this: mysql update listings set map= concat (ML, '.png') where ML''; but all I get is this: ERROR 1064 (42000): You

Re: update and concat

2004-11-30 Thread Roger Baklund
Thomas McDonough wrote: I'm trying to set all the values of column 'map' to the value of column ML and '.png'. My intuition and an extensive reading of the manual and mail archives tell me to do it like this: mysql update listings set map= concat (ML, '.png') where ML''; but all I get

Re: update and concat

2004-11-30 Thread gerald_clark
Thomas McDonough wrote: I'm trying to set all the values of column 'map' to the value of column ML and '.png'. My intuition and an extensive reading of the manual and mail archives tell me to do it like this: mysql update listings set map= concat (ML, '.png') where ML''; mysql update

Re: update and concat

2004-11-30 Thread Thomas McDonough
archives tell me to do it like this: mysql update listings set map= concat (ML, '.png') where ML''; mysql update listings set map= concat(ML, '.png') where ML''; Lose the space between 'concat' and '(' but all I get is this: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual

Re: update and concat

2004-11-30 Thread Michael Stassen
At this point, what you say you are doing should work, but doesn't. We cannot guess what's wrong. Please enter your command, UPDATE listings SET map = CONCAT(ML, '.png') WHERE ML ''; get your error message, and then copy/paste the whole thing into your next message. That way, someone

Update Query with special conditions.

2004-11-24 Thread list 123.
Using mySQL 4.0, I would like to know how I can code a query that will change the value of Participants.Active from Y to N is for three or more CONSECUTIVE sessions they have Attendance.Present = 'No'? The Attendance Table has Attendance.Session which coresponds to Sessions.SessionID and

Re: Update Query with special conditions.

2004-11-24 Thread GH
I am curious about doing something simular to this... does anyone have an idea On Wed, 24 Nov 2004 00:43:32 -0500, list 123. list wrote: Using mySQL 4.0, I would like to know how I can code a query that will change the value of Participants.Active from Y to N is for three or more CONSECUTIVE

ERROR 1216: Cannot add or update a child row: a foreign key constraint fails

2004-11-22 Thread Dayakar
Hello list, I am getting the following error when i am loading data (Tab seperated data) into a table which has reference to a primary key table. There is data in the primary key table, but still this error is being thrown. ERROR 1216: Cannot add or update a child row: a foreign key constraint

Re: ERROR 1216: Cannot add or update a child row: a foreign key constraint fails

2004-11-22 Thread Duncan Hill
1216: Cannot add or update a child row: a foreign key constraint fails Your data obviously has a row where the constraints are not valid. Either validate your data, or turn off the foreign key constraints temporarily when loading the data. -- MySQL General Mailing List For list archives: http

Re: long update query does not replicate correctly (cont.)

2004-11-18 Thread Sasha Pachev
. I have recently add the following line to the slave's my.cnf file: replicate-wild-do-table=abe_exp.% There are no more replication rules in that file. Both tables included in the multitable update were in this database (abe_exp). So this is a bug. I suggest then that you file a bug report at http

Fulltext insert/update

2004-11-15 Thread John Smith
I know that having a fulltext index on a table slows inserts and updates down (or I think I do...might have miss read something) I have a large table that uses fulltext which I plan to update nearly 90% of the rows (400,00+) and add new ones. It currently takes around 35 minutes to remove

Re: Fulltext insert/update

2004-11-15 Thread Sergei Golubchik
Hi! On Nov 15, John Smith wrote: I know that having a fulltext index on a table slows inserts and updates down (or I think I do...might have miss read something) I have a large table that uses fulltext which I plan to update nearly 90% of the rows (400,00+) and add new ones. It currently

Re: long update query does not replicate correctly (cont.)

2004-11-13 Thread Przemyslaw Popielarski
the following line to the slave's my.cnf file: replicate-wild-do-table=abe_exp.% There are no more replication rules in that file. Both tables included in the multitable update were in this database (abe_exp). So this is a bug. -- ./ premax ./ [EMAIL PROTECTED] ./ koniec i bomba, a kto czytal ten traba

long update query does not replicate correctly

2004-11-12 Thread Przemyslaw Popielarski
I'm executing on master a long and complicated query such: UPDATE (lots of tables, lots of LEFT JOIN) SET ... WHERE . The query updates i.e. 3816 rows. The query DOES replicate do master's and slave's binary log. But it DOES NOT execute on slave. 3816 rows are not updated on slave and slave

Re: long update query does not replicate correctly (cont.)

2004-11-12 Thread Przemyslaw Popielarski
I'm executing on master a long and complicated query such: UPDATE (lots of tables, lots of LEFT JOIN) SET ... WHERE . Okey, I simplified the query to: - UPDATE tKsidata, tKsiabeksiazki SET tKsidata.STAN_REALNY=tKsiabeksiazki.STAN WHERE tKsidata.ksi='0815120877

Re: long update query does not replicate correctly (cont.)

2004-11-12 Thread Sasha Pachev
Przemyslaw Popielarski wrote: I'm executing on master a long and complicated query such: UPDATE (lots of tables, lots of LEFT JOIN) SET ... WHERE . Okey, I simplified the query to: - UPDATE tKsidata, tKsiabeksiazki SET tKsidata.STAN_REALNY=tKsiabeksiazki.STAN WHERE

Re: Load data Infile update?

2004-11-05 Thread Gleb Paharenko
Hi. If your table has a unique index on field 'name', then use load data infile 'file' replace into table 'table'; Lewick, Taylor [EMAIL PROTECTED] wrote: Can I perform an update on a table using load data infile..? If I have the following table... Name Score Rank

Update query help

2004-11-05 Thread Jeff McKeon
I have two tables. One has a list of customers. The other has a record of customer transactions including unix datestamps of each transaction. I've added a field to the customer table called First_Transaction I want to update this field with the datestamp of the first transaction for each

Re: Update query help

2004-11-05 Thread SGreen
Break it down into two steps. Compute your new values by customerid, then update your customer table with your computed data. CREATE TEMPORARY TABLE tmpFirstTran SELECT CustID, min(Datestamp) as mindate from Transactions group by CustID; update Customer c INNER JOIN tmpFirstTran ft ON ft.CustID

RE: Update query help

2004-11-05 Thread Jeff McKeon
Yeah I thought of that but was hoping not to have to use a temp table. Thanks! Jeff -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, November 05, 2004 9:25 AM To: Jeff McKeon Cc: [EMAIL PROTECTED] Subject: Re: Update query help Break it down into two

Re: mysqld no longer starts after update 4.0 - 4.1

2004-11-04 Thread Stefan P. Wolf
Hello Gleb, Please read the notes about MySQL on Linux: http://dev.mysql.com/doc/mysql/en/Linux.html I don't find anything specific to my problem there, sorry! My Linux installation seems to be missing something that the bdb part of MySQL 4.1 needs and which was not needed by v4.0 and

Re: slashes in update statement

2004-11-04 Thread Andrew Kreps
On Wed, 3 Nov 2004 08:31:18 -0500 (EST), Ed Curtis [EMAIL PROTECTED] wrote: I'm trying to get a slash in a variable into my database and am having some trouble. If the variable = 1 1/2 it echoes to the screen correctly but it seems to strip the 1/2 off the variable when updating the value to

Re: slashes in update statement

2004-11-04 Thread ian douglas
I'm trying to get a slash in a variable into my database and am having some trouble. If the variable = 1 1/2 it echoes to the screen correctly but it seems to strip the 1/2 off the variable when updating the value to the database. Just FYI to everyone replying: Ed replied to me personally

Load data Infile update?

2004-11-04 Thread Lewick, Taylor
Can I perform an update on a table using load data infile..? If I have the following table... Name Score Rank John NULL NULL Susan NULL NULL And I have a data file that has... John,95,1 Susan,89,2 Any idea if this can be done? Thanks, -- MySQL General Mailing List For list archives

slashes in update statement

2004-11-03 Thread Ed Curtis
I'm trying to get a slash in a variable into my database and am having some trouble. If the variable = 1 1/2 it echoes to the screen correctly but it seems to strip the 1/2 off the variable when updating the value to the database. I'm using php and a form select list to get this value from a

Re: slashes in update statement

2004-11-03 Thread Gleb Paharenko
Hi. What type of the field in which you insert? Send us output of SHOW CREATE TABLE 'table'. Ed Curtis [EMAIL PROTECTED] wrote: I'm trying to get a slash in a variable into my database and am having some trouble. If the variable = 1 1/2 it echoes to the screen correctly but it

Re: slashes in update statement

2004-11-03 Thread Santino
Do you use POST or GET in the form? Try with a post. Santino At 8:31 -0500 3-11-2004, Ed Curtis wrote: I'm trying to get a slash in a variable into my database and am having some trouble. If the variable = 1 1/2 it echoes to the screen correctly but it seems to strip the 1/2 off the variable when

UPDATE LOW PRIORITY

2004-11-01 Thread Ronan Lucio
Hi All, I have o little (I think) doubt: If I use a query UPDATE LOW PRIORITY and right after I execute a SELECT in the same table/column. Will I receive the correct result or only after MySQL commit the data? Any help would be appreciated, Thanks, Ronan -- MySQL General Mailing List

Re: UPDATE LOW PRIORITY

2004-11-01 Thread Paul DuBois
At 12:26 -0300 11/1/04, Ronan Lucio wrote: Hi All, I have o little (I think) doubt: If I use a query UPDATE LOW PRIORITY and right after I execute a SELECT in the same table/column. Will I receive the correct result or only after MySQL commit the data? What is the correct result? Any help would

Re: UPDATE LOW PRIORITY

2004-11-01 Thread Ronan Lucio
What is the correct result? The correct result is the data in the updated column after commit. For example, if I have: Table1 = - id - name INSERT INTO Table1 (id, name) VALUES (1, 'AAA') UPDATE LOW PRIORITY Table1 SET name = 'BBB' SELECT name FROM Table1 Will it return BBB? Thanks

<    4   5   6   7   8   9   10   11   12   13   >