Bureaucrats, emailconfirmed, Administrators
840
edits
No edit summary |
|||
| Line 235: | Line 235: | ||
Il existe une exception. | Il existe une exception. | ||
Les requêtes "UPDATE FROM" | Les requêtes "UPDATE FROM" : | ||
Syntax MySQL : | Syntax MySQL : | ||
<source lang="sql"> | |||
UPDATE table_taget as target, table_source as source SET fieldtarget=source.fieldsource | UPDATE table_taget as target, table_source as source SET fieldtarget=source.fieldsource | ||
WHERE source.rowid=target.rowid; | WHERE source.rowid=target.rowid; | ||
</source> | |||
Syntax PgSQL: | Syntax PgSQL: | ||
<source lang="sql"> | |||
UPDATE table_taget as target SET fieldtarget=source.fieldsource | UPDATE table_taget as target SET fieldtarget=source.fieldsource | ||
FROM table_source as source WHERE source.rowid=target.rowid; | FROM table_source as source WHERE source.rowid=target.rowid; | ||
</source> | |||
Il n'en existe pas dans Dolibarr, mais pour vos modules Vous devriez faire tel que : | Il n'en existe pas dans Dolibarr, mais pour vos modules Vous devriez faire tel que : | ||
<source lang="php"> | |||
if ($this->db->type=='pgsql') { | if ($this->db->type=='pgsql') { | ||
$sql="UPDATE table_taget as target SET fieldtarget=source.fieldsource | $sql="UPDATE table_taget as target SET fieldtarget=source.fieldsource | ||
| Line 254: | Line 257: | ||
WHERE source.rowid=target.rowid"; | WHERE source.rowid=target.rowid"; | ||
} | } | ||
</source> | |||
= Normes HTML = | = Normes HTML = | ||