Re: Update multiple tables

2006-03-27 Thread Rhino
- Original Message - From: Mike Blezien [EMAIL PROTECTED] To: MySQL List mysql@lists.mysql.com Sent: Monday, March 27, 2006 3:39 PM Subject: Update multiple tables Hello, I'm alittle unclear on how too update multiple tables. We have two tables with the same column name

Re: Update multiple tables

2006-03-27 Thread SGreen
Mike Blezien [EMAIL PROTECTED] wrote on 03/27/2006 03:39:15 PM: Hello, I'm alittle unclear on how too update multiple tables. We have two tables with the same column name: account.state account_service.state when we update the account table, we also need to update

update statements problem

2006-03-20 Thread cybermalandro cybermalandro
I am trying to update a table with a file that has more than one update statements like this: UPDATE products set products_price=22.00 WHERE products_model=5217-01 OR products_model=521701 AND products_um=CS; UPDATE products set products_price=3 WHERE products_model=5217-01 OR products_model

Re: update statements problem

2006-03-20 Thread Johan Höök
Hi, I think your problem is that OR and AND do not have the same precedence, AND binds tighter. So what you need is probably: (products_model=5217-01 OR products_model=5217-01) AND products_um=CS and the same for PK and EA. The way you have you'll get an update as soon as products_model=5217-01

Re: update statements problem

2006-03-20 Thread SGreen
cybermalandro cybermalandro [EMAIL PROTECTED] wrote on 03/20/2006 11:00:51 AM: I am trying to update a table with a file that has more than one update statements like this: UPDATE products set products_price=22.00 WHERE products_model=5217-01 OR products_model=521701 AND products_um=CS

Re: update statements problem

2006-03-20 Thread cybermalandro cybermalandro
-01 OR products_model=5217-01) AND products_um=CS and the same for PK and EA. The way you have you'll get an update as soon as products_model=5217-01 /Johan cybermalandro cybermalandro wrote: I am trying to update a table with a file that has more than one update statements like

another update error

2006-03-20 Thread cybermalandro cybermalandro
Ok now I am running this statement UPDATE products INNER JOIN products_ums ON products.products_id = products_ums.products_id SET products_ums.products_ums_price=552 WHERE ( products.products_model=2420-01 OR products.products_model=242001) AND products_ums.products_ums_um=EA; and I am getting

Update Multiple Records

2006-03-18 Thread Rich
Hi folks. I want to set the status of 5 records to 'completed'. how do I go about that without having to prepare 5 different instructions? update myTable set status = 'completed' where id=10 OR id=20 OR id=30 OR id=40 OR id=50 I'm trying to reduce the number of instructions. Cheers

RE: Update Multiple Records

2006-03-18 Thread Daevid Vincent
update myTable set status = 'completed' where id IN (10,20,30,40,50) LIMIT 5; I believe that should work. As a precaution, I recommend always using LIMIT x whenever possible on SELECT, UPDATE or DELETE statements. This will minimize any accidental dammage to other records should you have

Re: Update Multiple Records

2006-03-18 Thread Rhino
- Original Message - From: Rich [EMAIL PROTECTED] To: mysql@lists.mysql.com Sent: Saturday, March 18, 2006 6:28 PM Subject: Update Multiple Records Hi folks. I want to set the status of 5 records to 'completed'. how do I go about that without having to prepare 5 different

RE: Error 1064: update .....select nested.

2006-03-16 Thread Ing. Edwin Cruz
update TABLE1 a, TABLE2 b set a.FIELD1=b.FIELD2 where column2='[EMAIL PROTECTED]' And column1 = '[EMAIL PROTECTED]' Or: update TABLE1 a, TABLE2 b set a.FIELD1=b.FIELD2 where b.column2=a.column1 And column1 = '[EMAIL PROTECTED]' Regards! -Mensaje original- De: Truong Tan Son [mailto

RE: Error 1064: update .....select nested.

2006-03-16 Thread SGreen
AAAUUUGGGHHH!!! You used the dreaded comma separated list !!! ;-) A more explicit way to write the same thing posted by Sr. Cruz... update TABLE1 a INNER JOIN TABLE2 b on a.id = b.other_id set a.FIELD1=b.FIELD2 WHERE a.column1='literal'; Actually posting a real query (instead

(SOLVED) Re: Error 1064: update .....select nested.

2006-03-16 Thread Truong Tan Son
Dear Sir, All solutions is very good ! update TABLE1 a INNER JOIN TABLE2 b on a.id = b.other_id set a.FIELD1=b.FIELD2 WHERE a.column1='literal'; Or update TABLE1 a, TABLE2 b set a.FIELD1=b.FIELD2 where column2='[EMAIL PROTECTED]' And column1 = '[EMAIL PROTECTED]' Or update TABLE1

Error 1064: update .....select nested.

2006-03-15 Thread Truong Tan Son
Dear Sir, MySQL-4.1.12 on RedHat Linux EL4: mysql update TABLE1 set FIELD1=(select FIELD2 from TABLE2 where COLUMN2= '[EMAIL PROTECTED]') where COLUMN1='[EMAIL PROTECTED]'; ERROR 1064: You have an error in your SQL syntax. Check the manual that corresp onds to your MySQL server version

Re: update using 'set' keyword

2006-03-14 Thread Prasanna Raj
Hi Iam not sure about the answer correct me if iam wrong :( Dont use single quotes in count_of_logons .. Try : $sql = UPDATE members SET count_of_logons = count_of_logons + 1 WHERE logon_id = '$logonid' AND logon_pw= '$logonpw

Re: Checking for good update

2006-03-13 Thread mysql
On Sun, 12 Mar 2006, Michael Stassen wrote: To: [EMAIL PROTECTED] From: Michael Stassen [EMAIL PROTECTED] Subject: Re: Checking for good update [EMAIL PROTECTED] wrote: looks a bit strange to me. $result = mysql_query($query) or die('Query couldn\'t executed:'.mysql_error

Re: Checking for good update

2006-03-13 Thread Michael Stassen
of the query at the same time, which AFAIK is not possible. You should try it. It works just fine, and isn't the problem. The problem is that you cannot treat the result of an UPDATE as if it were a SELECT. Regards Keith Roberts Yes, this is documented. It's also standard practice

Re: Checking for good update

2006-03-13 Thread mysql
Stassen wrote: To: [EMAIL PROTECTED] From: Michael Stassen [EMAIL PROTECTED] Subject: Re: Checking for good update [EMAIL PROTECTED] wrote: On Sun, 12 Mar 2006, Michael Stassen wrote: [EMAIL PROTECTED] wrote: looks a bit strange to me. $result = mysql_query($query

updating federated table affects only one row per request, should update more rows ..

2006-03-13 Thread Sebastian Mork
I try to update multiple rows in a federated table with one query, where field a=x and field b=x.. There are 4 rows that match these criteria (selecting returns 4 rows) but trying to update using the following query updates only one record. calling the same query 4 times, updates only one record

RE: Checking for good update

2006-03-13 Thread fbsd_user
Thank you Michael. I learned a lot from your detailed explanation of how the update and select functions work in relation to checking for good execution. I used if (mysql_affected_rows() == 1) and got the results I was after. I am stilling having problem with users browser caching the screen

update using 'set' keyword

2006-03-13 Thread fbsd_user
Trying to bump the count_of_logons by 1 using this update. Phpmyadmin shows the count staying at zero. I think that this SET count_of_logons = 'count_of_logons + 1' is not coded correctly, but I get no errors so can not tell. Anybody have any ideas? The table def has count_of_logons INT

Re: update using 'set' keyword

2006-03-13 Thread Michael Stassen
fbsd_user wrote: Trying to bump the count_of_logons by 1 using this update. Phpmyadmin shows the count staying at zero. I think that this SET count_of_logons = 'count_of_logons + 1' is not coded correctly, but I get no errors so can not tell. Anybody have any ideas? The table def has

Checking for good update

2006-03-12 Thread fbsd_user
Using this code I get this error message. Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /usr/local/www/data/mls_verifyemail.php on line 49 What code should I use to check if the update worked or not? $query = UPDATE members SET email_verified='X' WHERE

RE: Checking for good update

2006-03-12 Thread Logan, David (SST - Adelaide)
Perhaps reading the manual would be a good start at http://us3.php.net/manual/en/function.mysql-num-rows.php It clearly states Retrieves the number of rows from a result set. This command is only valid for SELECT statements. To retrieve the number of rows affected by a INSERT, UPDATE, or DELETE

RE: Checking for good update

2006-03-12 Thread fbsd_user
All ready read that and its clear as mud. It tells you update is different but gives no example. I asked in my post what should I code for checking the result of a update. -Original Message- From: Logan, David (SST - Adelaide) [mailto:[EMAIL PROTECTED] Sent: Sunday, March 12, 2006 4

Re: Checking for good update

2006-03-12 Thread mysql
looks a bit strange to me. $result = mysql_query($query) or die('Query couldn\'t executed:'.mysql_error()); please try something like this: // build the query - (that's OK) $query = UPDATE members SET email_verified='X' WHERE logon_id=' .$logonid. '; // send the query to the server - save

Re: Checking for good update

2006-03-12 Thread mysql
Maybe I need to read the copy of php pocket reference I have to David - LOL. Keith On Sun, 12 Mar 2006 [EMAIL PROTECTED] wrote: To: mysql@lists.mysql.com From: [EMAIL PROTECTED] Subject: Re: Checking for good update looks a bit strange to me. $result = mysql_query($query) or die

RE: Checking for good update

2006-03-12 Thread fbsd_user
Maybe I have the overall logic wrong. I don't do a select query first to see if that record is there. I just try to update it. If the logonid key in the update request is on the table, the record does get updated. I can verify that using phpmyadmin. When the logonid key in the update request

Re: Checking for good update

2006-03-12 Thread Michael Stassen
fbsd_user wrote: Using this code I get this error message. Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /usr/local/www/data/mls_verifyemail.php on line 49 What code should I use to check if the update worked or not? Your second line does just

Re: Checking for good update

2006-03-12 Thread Michael Stassen
[EMAIL PROTECTED] wrote: looks a bit strange to me. $result = mysql_query($query) or die('Query couldn\'t executed:'.mysql_error()); please try something like this: Why? There's nothing wrong with the above statement. // build the query - (that's OK) $query = UPDATE members SET

Re: UPDATE from monthly to yearly rows

2006-03-02 Thread C.R.Vegelin
Thanks Peter, I didn't know that MySQL has no UPDATE ... SELECT command. I followed your advice and made the following query UPDATE Data AS db INNER JOIN (SELECT myKey,Year, SUM(IF(Month= 1,Cell,Null)) AS `Jan`, ... SUM(IF(Month=12,Cell,Null)) AS `Dec` FROM Updates GROUP BY myKey, Year

UPDATE from monthly to yearly rows

2006-02-28 Thread C.R.Vegelin
Updates to 1 Data record where MyKey and Year are equal. I tried the following query: UPDATE Data AS db INNER JOIN Updates AS U ON db.myKey = U.myKey SET db.Jan = IF(U.Month = 1, U.Value, db.Jan), db.Feb = IF(U.Month = 2, U.Value, db.Feb), ... db.Dec = IF(U.Month=12, U.Value,db.Dec

Re: UPDATE from monthly to yearly rows

2006-02-28 Thread Peter Brawley
, but no UPDATE ... SELECT command, so this will be a two-step. If I understand your description correctly, you want to aggregate by month and report by mykey and year, so your crosstab would look something like this (not tested)... CREATE TEMPORARY TABLE crosstab SELECT d.myKey, d.year, SUM

Need Update Query Help (Urgent)

2006-02-20 Thread Veerabhadrarao Narra
Hi i ahve one table table_1 and columns like col_1,col_2,col_3 col_1 col_2 col_3 1 aa aaa 2 bb Now i want to update my table table_1 SET col_3 as bbb where max of col_1 I wrote this below Query but it shows error how to write UPDATE table_1 SET col_3 = 'bbb

Re: Need Update Query Help (Urgent)

2006-02-20 Thread Jeff Shapiro
On Monday 20 February 2006 03:27, Veerabhadrarao Narra wrote: Hi i ahve one table table_1 and columns like col_1,col_2,col_3 col_1 col_2 col_3 1 aa aaa 2 bb Now i want to update my table table_1 SET col_3 as bbb where max of col_1 I wrote this below

Re: Need Update Query Help (Urgent)

2006-02-20 Thread Peter Brawley
I wrote this below Query but it shows error how to write UPDATE table_1 SET col_3 = 'bbb' WHERE col_1 = (SELECT max(col_1) FROM table_1) See the docs for Update at http://dev.mysql.com/doc/refman/5.0/en/update.html. You cannot refer to the update table in a subquery. PB

RE: update a Blob field using UPDATE

2006-02-11 Thread Kerry Frater
it into the BLOB field using LOAD_FROM_FILE. Slower I know but I get no errors. Kerry -Original Message- From: Gleb Paharenko [mailto:[EMAIL PROTECTED] Sent: 03 February 2006 11:28 To: mysql@lists.mysql.com Subject: Re: update a Blob field using UPDATE Hello. Have you applied

Insert and Update together

2006-02-11 Thread Andre Matos
Hi List, I would like to know if it is possible to combine Insert and Update in one SQL instruction. This is what I want to do: I have two tables: one where I will perform and Update replacing m0 by scr. If MySQL find a m0, it will need to perform an insert into a log table including

Re: Insert and Update together

2006-02-11 Thread George Law
Andre, I tried this a couple weeks ago... I think you want the on duplicate option for the INSERT query. depends what version you have... I think this was introduced in mysql 4.1 insert into values () on duplicate key update set x=2,y=5; unfortunately, the server I was testing

Fw: Insert and Update together

2006-02-11 Thread Rhino
Oops, I meant to send this to the list so that everyone could benefit, not just to Andre. -- Rhino - Original Message - From: Rhino [EMAIL PROTECTED] To: Andre Matos [EMAIL PROTECTED] Sent: Saturday, February 11, 2006 12:11 PM Subject: Re: Insert and Update together

Re: Insert and Update together

2006-02-11 Thread Andre Matos
No George. I took a look there before sent this email to the mysql list. My case it is not a duplicate record. What I want is that if the update in one table happen, it will be proceed by an insert in another table like a log of changes. Andre On 2/11/06 12:48 PM, George Law [EMAIL PROTECTED

RE: Insert and Update together

2006-02-11 Thread Logan, David (SST - Adelaide)
--- -Original Message- From: Andre Matos [mailto:[EMAIL PROTECTED] Sent: Sunday, 12 February 2006 2:23 PM To: George Law; mysql@lists.mysql.com Subject: Re: Insert and Update together No George. I took a look there before sent this email

Re: update a Blob field using UPDATE

2006-02-03 Thread Gleb Paharenko
. In the table there is a text field of up to length 4000 chars. I have defined the column as blob in the MySQL table. I can read the text field of the source table into a variable e.g. mystring$. The MySQL table has been set, except for this data. I thought to use SQLString = UPDATE TheTable SET Notes

update a Blob field using UPDATE

2006-02-02 Thread Kerry Frater
for this data. I thought to use SQLString = UPDATE TheTable SET Notes = + mystring$ + WHERE TheTableRef = ' + Myref$ + '; I get error: You have an error in the SQL syntax I have tried to search the manual for an example of updating a blob column from a variable and cannot find one. I don't want to save

UPDATE behavior

2006-01-28 Thread Nicolas Verhaeghe
Is it normal for MySQL to not update fields that are already identical? I am talking about an INNER JOIN UPDATE, when copying from table A over table B. My count did not match at the first run and when I did the second run, I go a zero rows updated... -- MySQL General Mailing List For list

Re: UPDATE behavior

2006-01-28 Thread Gleb Paharenko
Hello. If you set a column to the value it currently has, MySQL notices this and does not update it. Perhaps it is the answer on your question. See: http://dev.mysql.com/doc/refman/5.0/en/update.html Nicolas Verhaeghe wrote: Is it normal for MySQL to not update fields that are already

insert...on duplicate key update...help

2006-01-26 Thread Jonathan Mangin
I'm trying to change a couple of replace statements to insert...on duplicate key update (using Perl/DBI). foreach my $key (keys %e_items) { my $sql = insert table1 (id, date, time, uid, type, seq, value) values

Re: insert...on duplicate key update...help

2006-01-26 Thread Gleb Paharenko
Hello. Perhaps you have forgotten to add col_name=expr to the end of your query. See: http://dev.mysql.com/doc/refman/5.0/en/insert.html Jonathan Mangin wrote: I'm trying to change a couple of replace statements to insert...on duplicate key update (using Perl/DBI). foreach my $key (keys

Update query

2006-01-24 Thread Jørn Dahl-Stamnes
values, but the format is different ('001234' vs 1234). Is it possible to create a update query that copies the 'foo' and 'bar' from table dbA.A to dbB.B for each record in dbB.B? -- Jørn Dahl-Stamnes homepage: http://www.dahl-stamnes.net/dahls/ -- MySQL General Mailing List For list archives

Re: Update query

2006-01-24 Thread Gleb Paharenko
row affected (0.00 sec) mysql select id+0 from ch; +--+ | id+0 | +--+ | 1234 | +--+ Use something similar to: update dbB, dbA set dbB.foo=dbA.foo, dbB.bar=dbA.bar where dbB.id=dbA.id ; See: http://dev.mysql.com/doc/refman/5.0/en/update.html Jørn Dahl-Stamnes wrote: Assume

Re: Update query

2006-01-24 Thread Jørn Dahl-Stamnes
(0.04 sec) mysql insert into ch set id='001234'; Query OK, 1 row affected (0.00 sec) mysql select id+0 from ch; +--+ | id+0 | +--+ | 1234 | +--+ Use something similar to: update dbB, dbA set dbB.foo=dbA.foo, dbB.bar=dbA.bar where dbB.id=dbA.id ; See: http

Re: UPDATE statement causes signal 11 on 5.0.16

2006-01-17 Thread Gleb Paharenko
) wrote: Hi, I'm running a 5.0.16 instance on a Debian box (2.6.13 kernel). The following statement causes a signal 11 without fail, and each time when mysqld_safe restarts the daemon, no socket file is created: UPDATE X_Products.product_details AS pd , X_Products.tblMaxProductStockDisplay

Re: UPDATE statement causes signal 11 on 5.0.16

2006-01-17 Thread Ian Sales (DBA)
Gleb Paharenko wrote: Hello. Please, could you explain what does it mean 'Signal 11 without fail'. Usually after receiving such a signal MySQL crashes. Of course, it should do this in normal circumstances. What is in the error log? Check if the problem still exists on official binaries of

Re: UPDATE statement causes signal 11 on 5.0.16

2006-01-17 Thread Gleb Paharenko
Hello. Resolve a stack trace and provide it to the list. See: http://dev.mysql.com/doc/refman/5.0/en/crashing.html http://dev.mysql.com/doc/refman/5.0/en/using-stack-trace.html Now about the replication problem. As I've understood you have triggers only on the slave. In my opinion, to solve

Re: UPDATE statement causes signal 11 on 5.0.16

2006-01-17 Thread Ian Sales (DBA)
Gleb Paharenko wrote: Hello. Resolve a stack trace and provide it to the list. See: http://dev.mysql.com/doc/refman/5.0/en/crashing.html http://dev.mysql.com/doc/refman/5.0/en/using-stack-trace.html - resolving the stack dump gives me this:- 0x8150650 + 135595600 0xe420 + -7136

UPDATE statement causes signal 11 on 5.0.16

2006-01-16 Thread Ian Sales (DBA)
Hi, I'm running a 5.0.16 instance on a Debian box (2.6.13 kernel). The following statement causes a signal 11 without fail, and each time when mysqld_safe restarts the daemon, no socket file is created: UPDATE X_Products.product_details AS pd , X_Products.tblMaxProductStockDisplay AS sd SET

UPDATE Date Column

2006-01-16 Thread Shaun
Hi, I have a 2 Date Columns in my table, how can I update the 2nd date column so that the dates are 3 months previous to the orignial date column for every row. Thanks for your advice -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http

Re: UPDATE Date Column

2006-01-16 Thread Ady Wicaksono
Hi Shaun You could use DATE_ADD function with interval negative Shaun wrote: Hi, I have a 2 Date Columns in my table, how can I update the 2nd date column so that the dates are 3 months previous to the orignial date column for every row. Thanks for your advice -- MySQL

RE: UPDATE Date Column

2006-01-16 Thread Patrick Herber
Do you mean something like that? UPDATE tablename SET date2=DATE_ADD(date1, INTERVAL -3 MONTH) Regards, Patrick -Original Message- From: Shaun [mailto:[EMAIL PROTECTED] Sent: Monday, 16 January 2006 15:27 To: mysql@lists.mysql.com Subject: UPDATE Date Column Hi, I have a 2

Re: UPDATE Date Column

2006-01-16 Thread Shaun
Thanks Patrick, Will this work on 3.23? Patrick Herber [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Do you mean something like that? UPDATE tablename SET date2=DATE_ADD(date1, INTERVAL -3 MONTH) Regards, Patrick -Original Message- From: Shaun [mailto:[EMAIL

Re: UPDATE Date Column

2006-01-16 Thread Martijn Tonies
- tool for InterBase, Firebird, MySQL, Oracle MS SQL Server Upscene Productions http://www.upscene.com Database development questions? Check the forum! http://www.databasedevelopmentforum.com Do you mean something like that? UPDATE tablename SET date2=DATE_ADD(date1, INTERVAL -3 MONTH

Re: How to update record obtained from a query result?

2006-01-10 Thread Jan M
Hi, Thanks for your help. Regards, Jan -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: How to update record obtained from a query result?

2006-01-09 Thread Jigal van Hemert
Jan M schreef: How do I update a record obtained from a query result while ensuring that: 1) The record is the actual record in the database not a possible duplicate, e.g. is there a built-in record number identifying the actual DB record or do I have to organise that in the table structure

RE: [SPAM] - concat string and update question - Found word(s) remove list in the Text body

2006-01-09 Thread Gordon Bruce
Try this UPDATE people SETphone = CASE WHEN LEFT(phone,4) = '405_' THEN MID(phone,5,20) WHEN LEFT(phone,3) = '405' THEN MID(phone,4,20) ELSE phone END FROM people WHERE LEFT(phone,3) = '405' AND LENGTH(phone

Re: How to update record obtained from a query result?

2006-01-09 Thread Gleb Paharenko
-tables.html http://dev.mysql.com/doc/refman/5.0/en/innodb-transaction-model.html Jan M wrote: Hi, Newbie question (MySql 5.0 using C API). I've searched the mysql website/Internet but cannot find the answer. How do I update a record obtained from a query result while ensuring

How to update record obtained from a query result?

2006-01-08 Thread Jan M
Hi, Newbie question (MySql 5.0 using C API). I've searched the mysql website/Internet but cannot find the answer. How do I update a record obtained from a query result while ensuring that: 1) The record is the actual record in the database not a possible duplicate, e.g. is there a built

Re: How come this update does not work??

2006-01-06 Thread Bruce Ferrell
Carlos Vasquez wrote: How come this doesn't work? Wp_photos.photo = IMG_1234.JPG Pixelpost_pixelpost.headline = /this/path/to/directory/IMG_1234.JPG So I need to just match the latter-bit of the file. update pixelpost_pixelpost,wp_posts,wp_photos set pixelpost_pixelpost.headline

How come this update does not work??

2006-01-05 Thread Carlos Vasquez
How come this doesn't work? Wp_photos.photo = IMG_1234.JPG Pixelpost_pixelpost.headline = /this/path/to/directory/IMG_1234.JPG So I need to just match the latter-bit of the file. update pixelpost_pixelpost,wp_posts,wp_photos set pixelpost_pixelpost.headline=wp_posts.post_title

backslash and Update

2005-12-30 Thread Jerry Swanson
I have 290 records in the database with backslashes. I want to remove the backslashes. Why the query below doesn't remove backslashes? update name set first_name = REPLACE(first_name,'','') where first_name like '%%';

Re: backslash and Update

2005-12-30 Thread Danny Stolle
Hi, What you perhaps could use is the REGEXP usage in your where clause. Try this: update name set first_name=replace(first_name, '\\', '') where first_name regexp ''; The fun thing is that when you put '\\' instead of the '' after the regexp function it doesn't work. But this sure

Re: backslash and Update

2005-12-30 Thread Michael Stassen
Danny Stolle wrote: Hi, What you perhaps could use is the REGEXP usage in your where clause. Try this: update name set first_name=replace(first_name, '\\', '') where first_name regexp ''; The fun thing is that when you put '\\' instead of the '' after the regexp function it doesn't

update or insert if necessary?

2005-12-28 Thread steve
I have a situation where I need to update a record for a given key in a MySQL table, but insert a record if the key doesn't exist. I could do this by doing a SELECT on the key, then doing an UPDATE if anything comes back, or and INSERT otherwise. This seems rather clunky though, and I'm

Re: update or insert if necessary?

2005-12-28 Thread Jeremiah Gowdy
http://dev.mysql.com/doc/refman/5.0/en/replace.html - Original Message - From: steve [EMAIL PROTECTED] To: mysql@lists.mysql.com Sent: Wednesday, December 28, 2005 6:57 AM Subject: update or insert if necessary? I have a situation where I need to update a record for a given key

Re: update or insert if necessary?

2005-12-28 Thread Jeremiah Gowdy
Actually, you may be more interested in: INSERT . ON DUPLICATE KEY UPDATE - Original Message - From: steve [EMAIL PROTECTED] To: mysql@lists.mysql.com Sent: Wednesday, December 28, 2005 6:57 AM Subject: update or insert if necessary? I have a situation where I need to update

RE: update or insert if necessary?

2005-12-28 Thread John Trammell
You should read http://dev.mysql.com/doc/refman/4.1/en/insert.html and maybe http://dev.mysql.com/doc/refman/4.1/en/replace.html -Original Message- From: steve [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 28, 2005 8:57 AM To: mysql@lists.mysql.com Subject: update or insert

Problem with UPDATE syntax when updating multiple tables

2005-12-15 Thread Matthew Batt
Hi I need to update the 'products_id' field (shown below) by copying data from a separate table but I can't use the 'UPDATE' query as each 'product_id' entry relates to a specific 'products_model' row. id / assembly_no / products_id / products_model 1 / 2313 / *** / CASEACERENTRY2 2 / 2313

Re: Problem with UPDATE syntax when updating multiple tables

2005-12-15 Thread Gleb Paharenko
Hello. Please, could you provide the CREATE statement for you tables and describe the relationships between their fields (it will be good if you include sample data as well). Matthew Batt wrote: Hi I need to update the 'products_id' field (shown below) by copying data from

ANN: Database Workbench 2.8.0 update

2005-12-09 Thread Martijn Tonies
Ladies, gentlemen, This week, Database Workbench 2.8.0 was released. However, that build included an error with MySQL and loading index metadata and an specific error with Firebird/InterBase. There's a new installer available at our website. Below is the original announcement...

Re: sporadic batch update problem

2005-12-05 Thread Joerg Bruehe
Hi Jeff, all! Jeff Drew wrote: Sporadically, the last few entries of a batch are not written. I'm writing to a mysql database using JDBC. Here's a short version of my code. Does anyone have suggestions on possible causes or other diagnostics? I do not claim any JBDC knowledge, so I have

sporadic batch update problem

2005-12-04 Thread Jeff Drew
Sporadically, the last few entries of a batch are not written. I'm writing to a mysql database using JDBC. Here's a short version of my code. Does anyone have suggestions on possible causes or other diagnostics? class DatabaseWriter{ int writeCount=0; public DatabaseWriter(){

Newbie Question on Update

2005-11-30 Thread Kraer, Joseph
I am trying to update a couple of rows in a table by doing the following: update table set column5 = number1 where column 1 = number2 and column1 = number3 but it is not working. I tried listing the conditions separated by commas (where column 1 = number2, column1 = number3) and also didn't

Re: Newbie Question on Update

2005-11-30 Thread Michael Stassen
Kraer, Joseph wrote: I am trying to update a couple of rows in a table by doing the following: update table set column5 = number1 where column 1 = number2 and column1 = number3 This appears to be correct syntax. but it is not working. We can't help you if you don't tell us what you mean

RE: Newbie Question on Update

2005-11-30 Thread ISC Edwin Cruz
I guess that the problem is the reserved word table Try it: Update `table` Set column5=number1 where column 1 = number2 and column1 = number3 But the sintax is ok Regards! -Mensaje original- De: Kraer, Joseph [mailto:[EMAIL PROTECTED] Enviado el: Miércoles, 30 de Noviembre de 2005 10

Re: Newbie Question on Update

2005-11-30 Thread SGreen
Kraer, Joseph [EMAIL PROTECTED] wrote on 11/30/2005 11:58:56 AM: I am trying to update a couple of rows in a table by doing the following: update table set column5 = number1 where column 1 = number2 and column1 = number3 but it is not working. I tried listing the conditions separated

RE: Newbie Question on Update

2005-11-30 Thread mel list_php
Hi, In your query you try to update on the condition column 1 = number2 and column1 = number3. I think what you want is column 1 = number2 or column1 = number3 . If you use and it will try and found a record in column which has a value = number2 and at the same time = number3. hth, melanie

RE: Newbie Question on Update

2005-11-30 Thread Kraer, Joseph
Thank you, Shawn, for understanding what I meant and for explaining the issue so clearly. I apologize to all others if I wasn't clear enough, but, yes, I wanted to update two separate rows. Now, I understand why an OR is needed; I'll study the other option too. Thank you, Joseph Tito Kraer

Re: Newbie question: UPDATE

2005-11-30 Thread Gleb Paharenko
Hello. I'm not a PHPMyAdmin guru, but at least LOAD DATA LOCAL feature (if it is present in PHPMyAdmin) can be disabled due to some security reasons. See: http://dev.mysql.com/doc/refman/5.0/en/load-data-local.html Joe Herman wrote: To those thinking of answering this question,

Re: Newbie Question on Update

2005-11-30 Thread Peter Brawley
Joseph update table set column5 = number1 where column 1 = number2 and column1 = number3 but it is not working. I tried listing the conditions separated by commas (where column 1 = number2, column1 = number3) and also didn't work. What am I doing wrong? No commas in the WHERE clause. WHERE

Re: Newbie question: UPDATE

2005-11-28 Thread Gleb Paharenko
Hello. I'm not PHPMyAdmin guru, but at least LOAD DATA LOCAL feature (if it is present in PHPMyAdmin) can be disabled due to some security reasons. See: http://dev.mysql.com/doc/refman/5.0/en/load-data-local.html Joe Herman wrote: To those thinking of answering this question,

Re: UPDATE and INDEX updates

2005-11-28 Thread sheeri kritzer
it pretty well. -Sheeri On 11/23/05, Mike OK [EMAIL PROTECTED] wrote: Thanks for the point to the internals. I will keep this page bookmarked. I read everything there regarding indexes and did not find the answer I was looking for. I think what I need falls under the UPDATE statement

Newbie question: UPDATE

2005-11-27 Thread Joe Herman
To those thinking of answering this question, There is additional information. For some reason, I found out that the version of PHPMyAdmin at my web hosting provider was missing the Insert data from a text file into the table feature found at the bottom of the page after clicking on the name of

Re: UPDATE and INDEX updates

2005-11-23 Thread Gleb Paharenko
Hello. don't think I will find the answer to this question in the normal manuals but rather from someone / place that deals with the internals of the system. Mike MySQL internals are available at: http://dev.mysql.com/doc/internals/en/ Mike OK wrote: I did read the manuals

Re: UPDATE and INDEX updates

2005-11-23 Thread Mike OK
Thanks for the point to the internals. I will keep this page bookmarked. I read everything there regarding indexes and did not find the answer I was looking for. I think what I need falls under the UPDATE statement (no listing there). Specifically, what triggers the action for index re-builds

Re: UPDATE and INDEX updates

2005-11-22 Thread sheeri kritzer
Mike, The documentation at http://dev.mysql.com/doc/refman/5.0/en/update.html explains that MySQL is aware of the fact that it only needs to update different values -- for instance, it returns only the # of rows changed, not the # of rows looked at. Given that, I will extrapolate that MySQL

Re: UPDATE and INDEX updates

2005-11-22 Thread Mike OK
- Original Message - From: sheeri kritzer [EMAIL PROTECTED] To: MySQL List mysql@lists.mysql.com Sent: November 22, 2005 9:31 AM Subject: Re: UPDATE and INDEX updates Mike, The documentation at http://dev.mysql.com/doc/refman/5.0/en/update.html explains that MySQL is aware of the fact that it only

Re: UPDATE and INDEX updates

2005-11-22 Thread sheeri kritzer
-placed?? Does MySQL look at each column value first to compare?? Mike - Original Message - From: sheeri kritzer [EMAIL PROTECTED] To: MySQL List mysql@lists.mysql.com Sent: November 22, 2005 9:31 AM Subject: Re: UPDATE and INDEX updates Mike, The documentation at http

Re: UPDATE and INDEX updates

2005-11-22 Thread Mike OK
: November 22, 2005 3:05 PM Subject: Re: UPDATE and INDEX updates You're going to have to read the manual on the different types of indexes. Without knowing what kind of index (Hash, B-tree) you're using and on what kind of table, I cannot help you. Parts of Chapter 14 of the MySQL manual

UPDATE and INDEX updates

2005-11-21 Thread Mike OK
Hi I was wondering how the index process worked internally for UPDATE statements. If I was to set a value for a column with the UPDATE statement but the value was the same, would MySQL re-work the index?? I can check for data change for each column inside of my code before UPDATE

Is Load Data Infile or Update is faster?

2005-11-19 Thread mos
I am doing a balance line comparison between the rows of an existing table and a text file that has newer data in it. So I'm comparing the values field by field to the existing rows in the table. If any of the field values are different, I need to update the table with these new values

Re: Is Load Data Infile or Update is faster?

2005-11-19 Thread Rhino
- Original Message - From: mos [EMAIL PROTECTED] To: mysql@lists.mysql.com Sent: Saturday, November 19, 2005 8:16 PM Subject: Is Load Data Infile or Update is faster? I am doing a balance line comparison between the rows of an existing table and a text file that has newer data

<    1   2   3   4   5   6   7   8   9   10   >