Re: Port Oracle to PostgreSQL Compiere

From: Alvaro Herrera <alvherre(at)surnet(dot)cl>
To: Juanky Moral <juanky(dot)moral(at)gmail(dot)com>
Cc: Victor <victor(dot)perez(at)e-evolution(dot)com>, pgsql-es-ayuda(at)postgresql(dot)org
Subject: Re: Port Oracle to PostgreSQL Compiere
Date: 2005-07-04 19:45:52
Message-ID: 20050704194552.GA23606@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

On Mon, Jul 04, 2005 at 09:24:39PM +0200, Juanky Moral wrote:
> El 4/07/05, Alvaro Herrera<alvherre(at)surnet(dot)cl> escribió:
> > On Mon, Jul 04, 2005 at 08:42:44PM +0200, Juanky Moral wrote:
> > > EN POSTGRES:
> > > UPDATE AD_User SET
> > > AD_User.C_Greeting_ID=I_BPartner.C_Greeting_ID,
> > > AD_User.Name=I_BPartner.Name,
> > > ....el resto de la comalist set...
> > > FROM AD_User INNER JOIN I_BPartner ON
> > > AD_User.C_Greeting_ID=I_BPartner.I_BPartner_ID;
> >
> > No tienes que repetir la tabla AD_User en el FROM. Ya esta
> > implicitamente incluida, por ser la tabla a la que haces UPDATE. Me
> > parece que haciendo esto tienes un producto cartesiano.

> > Agregar a esto la lectura la documentacion de UPDATE.

> Creo que no. Estoy haciendo un JOIN donde las CP de ambas tablas
> coincidan. (Mira la la cláusula ON).
> No sabía que se pudiera omitir la tabla del UPDATE, lo cierto es que
> he probado este tipo de UPDATES antes, sobre todo cuando hay que
> normalizar alguna tabla, y funciona bien.

No por nada puse una indicacion de mirar la documentacion:

Synopsis

UPDATE [ ONLY ] table SET column = { expression | DEFAULT } [, ...]
[ FROM fromlist ]
[ WHERE condition ]

[mas abajo]

fromlist

A list of table expressions, allowing columns from other tables to appear
in the WHERE condition and the update expressions. This is similar to the list
of tables that can be specified in the FROM Clause of a SELECT statement. Note
that the target table must not appear in the fromlist, unless you intend a
self-join (in which case it must appear with an alias in the fromlist).

--
Alvaro Herrera (<alvherre[a]surnet.cl>)
"El hombre nunca sabe de lo que es capaz hasta que lo intenta" (C. Dickens)

In response to

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Alvaro Herrera 2005-07-04 19:46:56 Re: Port Oracle to PostgreSQL Compiere
Previous Message Leonel Nunez 2005-07-04 19:31:14 Re: AYUDA CON PHP+POSTGRESQL