Обсуждение: generating UPDATE SET ... WHERE PK = ...

Поиск
Список
Период
Сортировка

generating UPDATE SET ... WHERE PK = ...

От
Laurent ROCHE
Дата:
<div style="font-family:arial,helvetica,sans-serif;font-size:10pt">Hi,<br /><div style="font-family:
arial,helvetica,sans-serif;font-size: 10pt;"><div style="font-family: times new roman,new york,times,serif; font-size:
12pt;"><divstyle="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><br />I would like to generate with a
requesta SQL order like <br />UPDATE tab1<br /> SET col_a = ?, col_b = ? ...<br />WHERE pk = ?<br /><br />for each
tableof a given schema (in fact what I want is slightly more complicated but if I can write the above, I will be able
toget the rest).<br /><br />Will anyone be kind enough to share a piece of code doing this (from pgAdmin may be) ?<br
/><br/><br />Cheers,<br />L@u<br />The Computing Froggy</div></div><br /></div></div><br /><hr size="1" /> Ne gardez
plusqu'une seule adresse mail ! <a href="http://www.trueswitch.com/yahoo-fr/">Copiez vos mails</a> vers Yahoo! Mail  

Re: generating UPDATE SET ... WHERE PK = ...

От
Guillaume Lelarge
Дата:
Laurent ROCHE a écrit :
> I would like to generate with a request a SQL order like
> UPDATE tab1
>  SET col_a = ?, col_b = ? ...
> WHERE pk = ?
> 
> for each table of a given schema (in fact what I want is slightly more
> complicated but if I can write the above, I will be able to get the rest).
> 
> Will anyone be kind enough to share a piece of code doing this (from
> pgAdmin may be) ?
> 

Why don't you use the UPDATE script from pgAdmin's table contextual menu ?

Regards.


-- 
Guillaume.http://www.postgresqlfr.orghttp://dalibo.com