PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.databases.mysql > Mysql multiple table update
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Mysql multiple table update

Réponse
 
LinkBack Outils de la discussion
Vieux 16/10/2007, 11h14   #1
gianpaolo.pelloni
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Mysql multiple table update

Hi all! I'm working on a MySql 3.23.58 and i need to do a multiplate
table UPDATE.

I need something equivalent to:

UPDATE table1 INNER JOIN tabl2 USING(id1) INNER JOIN table3 ON
table1.id1 = table3.id3 SET table2.acquisition_price =
REPLACE(table3.field3, ',', '.');

Any suggestion?

Thank you

  Réponse avec citation
Vieux 16/10/2007, 11h56   #2
Captain Paralytic
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Mysql multiple table update

On 16 Oct, 10:14, "gianpaolo.pelloni" <gianpaolo.pell...@tin.it>
wrote:
> Hi all! I'm working on a MySql 3.23.58 and i need to do a multiplate
> table UPDATE.
>
> I need something equivalent to:
>
> UPDATE table1 INNER JOIN tabl2 USING(id1) INNER JOIN table3 ON
> table1.id1 = table3.id3 SET table2.acquisition_price =
> REPLACE(table3.field3, ',', '.');
>
> Any suggestion?
>
> Thank you


Well, the manual that says it covers 3.23, 4.0, 4.1 states that multi
table updates are valid, so I suggest you go ahead and do it.

  Réponse avec citation
Vieux 16/10/2007, 12h10   #3
gianpaolo
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Mysql multiple table update

On 16 Ott, 11:56, Captain Paralytic <paul_laut...@yahoo.com> wrote:
> On 16 Oct, 10:14, "gianpaolo.pelloni" <gianpaolo.pell...@tin.it>
> wrote:
>
> > Hi all! I'm working on a MySql 3.23.58 and i need to do a multiplate
> > table UPDATE.

>
> > I need something equivalent to:

>
> > UPDATE table1 INNER JOIN tabl2 USING(id1) INNER JOIN table3 ON
> > table1.id1 = table3.id3 SET table2.acquisition_price =
> > REPLACE(table3.field3, ',', '.');

>
> > Any suggestion?

>
> > Thank you

>
> Well, the manual that says it covers 3.23, 4.0, 4.1 states that multi
> table updates are valid, so I suggest you go ahead and do it.


I've read the manual, but when i try to tun the query, i get this
error:
You have an error in your SQL syntax near 'INNER JOIN table2 ...' at
line 1 in

Further more, i've searched online the manual for 3.23 version of
mysql http://www.science.uva.nl/ict/ossdoc...ce.html#UPDATE
where you can read the exact syntax:

UPDATE [LOW_PRIORITY] [IGNORE] tbl_name
SET col_name1=expr1, [col_name2=expr2, ...]
[WHERE where_definition]
[ORDER BY ...]
[LIMIT #]

There are no joins available.
So i need a way to do that query above not using any kind of JOIN
statement.
I need to update something like 8000 records, and i don't wanto to do
that by hand on with 8000 different queries..

Any idea?

Thanks for your reply Captain Paralytic

  Réponse avec citation
Vieux 16/10/2007, 12h40   #4
Captain Paralytic
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Mysql multiple table update

On 16 Oct, 11:10, gianpaolo <gianpaolo.pell...@tin.it> wrote:
> On 16 Ott, 11:56, Captain Paralytic <paul_laut...@yahoo.com> wrote:
>
>
>
>
>
> > On 16 Oct, 10:14, "gianpaolo.pelloni" <gianpaolo.pell...@tin.it>
> > wrote:

>
> > > Hi all! I'm working on a MySql 3.23.58 and i need to do a multiplate
> > > table UPDATE.

>
> > > I need something equivalent to:

>
> > > UPDATE table1 INNER JOIN tabl2 USING(id1) INNER JOIN table3 ON
> > > table1.id1 = table3.id3 SET table2.acquisition_price =
> > > REPLACE(table3.field3, ',', '.');

>
> > > Any suggestion?

>
> > > Thank you

>
> > Well, the manual that says it covers 3.23, 4.0, 4.1 states that multi
> > table updates are valid, so I suggest you go ahead and do it.

>
> I've read the manual, but when i try to tun the query, i get this
> error:
> You have an error in your SQL syntax near 'INNER JOIN table2 ...' at
> line 1 in
>
> Further more, i've searched online the manual for 3.23 version of
> mysqlhttp://www.science.uva.nl/ict/ossdocs/mysql/manual_Reference.html#UPDATE
> where you can read the exact syntax:
>
> UPDATE [LOW_PRIORITY] [IGNORE] tbl_name
> SET col_name1=expr1, [col_name2=expr2, ...]
> [WHERE where_definition]
> [ORDER BY ...]
> [LIMIT #]
>
> There are no joins available.
> So i need a way to do that query above not using any kind of JOIN
> statement.
> I need to update something like 8000 records, and i don't wanto to do
> that by hand on with 8000 different queries..
>
> Any idea?
>
> Thanks for your reply Captain Paralytic- Hide quoted text -
>
> - Show quoted text -


Now we are getting somewhere. Since eyou are using such an old and
unsupported version of MySQL, when I looked in the "official" manual
and it said that what you were doing was fine, I could tell you no
more.

If you post a query and that query is failing when you run it, ALWAYS
post the error that you are seeing. We do not have crystal balls that
show us what you don't post.

I was going to suggest a 2 stage process using a temporary table and
the ON DUPLIATE KEY option of INSERT, but that document that you found
suggests that this too is not available.

How about moving the tables to a MySQL 4 or 5 installation, doing the
update and them moving them back. Or even better, upgrade MySQL!

  Réponse avec citation
Vieux 16/10/2007, 13h01   #5
gianpaolo
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Mysql multiple table update

On 16 Ott, 12:40, Captain Paralytic <paul_laut...@yahoo.com> wrote:
> On 16 Oct, 11:10, gianpaolo <gianpaolo.pell...@tin.it> wrote:
>
>
>
> > On 16 Ott, 11:56, Captain Paralytic <paul_laut...@yahoo.com> wrote:

>
> > > On 16 Oct, 10:14, "gianpaolo.pelloni" <gianpaolo.pell...@tin.it>
> > > wrote:

>
> > > > Hi all! I'm working on a MySql 3.23.58 and i need to do a multiplate
> > > > table UPDATE.

>
> > > > I need something equivalent to:

>
> > > > UPDATE table1 INNER JOIN tabl2 USING(id1) INNER JOIN table3 ON
> > > > table1.id1 = table3.id3 SET table2.acquisition_price =
> > > > REPLACE(table3.field3, ',', '.');

>
> > > > Any suggestion?

>
> > > > Thank you

>
> > > Well, the manual that says it covers 3.23, 4.0, 4.1 states that multi
> > > table updates are valid, so I suggest you go ahead and do it.

>
> > I've read the manual, but when i try to tun the query, i get this
> > error:
> > You have an error in your SQL syntax near 'INNER JOIN table2 ...' at
> > line 1 in

>
> > Further more, i've searched online the manual for 3.23 version of
> > mysqlhttp://www.science.uva.nl/ict/ossdocs/mysql/manual_Reference.html#UPDATE
> > where you can read the exact syntax:

>
> > UPDATE [LOW_PRIORITY] [IGNORE] tbl_name
> > SET col_name1=expr1, [col_name2=expr2, ...]
> > [WHERE where_definition]
> > [ORDER BY ...]
> > [LIMIT #]

>
> > There are no joins available.
> > So i need a way to do that query above not using any kind of JOIN
> > statement.
> > I need to update something like 8000 records, and i don't wanto to do
> > that by hand on with 8000 different queries..

>
> > Any idea?

>
> > Thanks for your reply Captain Paralytic- Hide quoted text -

>
> > - Show quoted text -

>
> Now we are getting somewhere. Since eyou are using such an old and
> unsupported version of MySQL, when I looked in the "official" manual
> and it said that what you were doing was fine, I could tell you no
> more.
>
> If you post a query and that query is failing when you run it, ALWAYS
> post the error that you are seeing. We do not have crystal balls that
> show us what you don't post.
>
> I was going to suggest a 2 stage process using a temporary table and
> the ON DUPLIATE KEY option of INSERT, but that document that you found
> suggests that this too is not available.
>
> How about moving the tables to a MySQL 4 or 5 installation, doing the
> update and them moving them back. Or even better, upgrade MySQL!


Now it seems that the only solution is to upgrade database, because i
need to run that kind of queries once a day.

Thank you for your reply Captain Paralytic, and I'm sorry for being
novice

  Réponse avec citation
Vieux 16/10/2007, 13h10   #6
Captain Paralytic
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Mysql multiple table update

On 16 Oct, 12:01, gianpaolo <gianpaolo.pell...@tin.it> wrote:
> On 16 Ott, 12:40, Captain Paralytic <paul_laut...@yahoo.com> wrote:
>
>
>
>
>
> > On 16 Oct, 11:10, gianpaolo <gianpaolo.pell...@tin.it> wrote:

>
> > > On 16 Ott, 11:56, Captain Paralytic <paul_laut...@yahoo.com> wrote:

>
> > > > On 16 Oct, 10:14, "gianpaolo.pelloni" <gianpaolo.pell...@tin.it>
> > > > wrote:

>
> > > > > Hi all! I'm working on a MySql 3.23.58 and i need to do a multiplate
> > > > > table UPDATE.

>
> > > > > I need something equivalent to:

>
> > > > > UPDATE table1 INNER JOIN tabl2 USING(id1) INNER JOIN table3 ON
> > > > > table1.id1 = table3.id3 SET table2.acquisition_price =
> > > > > REPLACE(table3.field3, ',', '.');

>
> > > > > Any suggestion?

>
> > > > > Thank you

>
> > > > Well, the manual that says it covers 3.23, 4.0, 4.1 states that multi
> > > > table updates are valid, so I suggest you go ahead and do it.

>
> > > I've read the manual, but when i try to tun the query, i get this
> > > error:
> > > You have an error in your SQL syntax near 'INNER JOIN table2 ...' at
> > > line 1 in

>
> > > Further more, i've searched online the manual for 3.23 version of
> > > mysqlhttp://www.science.uva.nl/ict/ossdocs/mysql/manual_Reference.html#UPDATE
> > > where you can read the exact syntax:

>
> > > UPDATE [LOW_PRIORITY] [IGNORE] tbl_name
> > > SET col_name1=expr1, [col_name2=expr2, ...]
> > > [WHERE where_definition]
> > > [ORDER BY ...]
> > > [LIMIT #]

>
> > > There are no joins available.
> > > So i need a way to do that query above not using any kind of JOIN
> > > statement.
> > > I need to update something like 8000 records, and i don't wanto to do
> > > that by hand on with 8000 different queries..

>
> > > Any idea?

>
> > > Thanks for your reply Captain Paralytic- Hide quoted text -

>
> > > - Show quoted text -

>
> > Now we are getting somewhere. Since eyou are using such an old and
> > unsupported version of MySQL, when I looked in the "official" manual
> > and it said that what you were doing was fine, I could tell you no
> > more.

>
> > If you post a query and that query is failing when you run it, ALWAYS
> > post the error that you are seeing. We do not have crystal balls that
> > show us what you don't post.

>
> > I was going to suggest a 2 stage process using a temporary table and
> > the ON DUPLIATE KEY option of INSERT, but that document that you found
> > suggests that this too is not available.

>
> > How about moving the tables to a MySQL 4 or 5 installation, doing the
> > update and them moving them back. Or even better, upgrade MySQL!

>
> Now it seems that the only solution is to upgrade database, because i
> need to run that kind of queries once a day.
>
> Thank you for your reply Captain Paralytic, and I'm sorry for being
> novice- Hide quoted text -
>
> - Show quoted text -


No need to apologise for being a novice, but even a novice should be
able to realise that they ned to give enough information to identify
the problem.

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 00h58.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,17688 seconds with 14 queries