Yes thanks -I am trying to figure writing out a script
that will do the update than doing individual inserts or update.I'll
try this idea. From: Timo Klecker [mailto:klecker@xxxxxxxxx] Sent: Friday, March 26, 2010 10:51 AM To: Rajan, Pavithra ; pgsql-general@xxxxxxxxxxxxxx Subject: AW: Need help on updating an entire column with a list of values, I have. Hello, you
could use an plpgsql function: CREATE
OR REPLACE FUNCTION update(numeric[])
RETURNS void AS $BODY$ declare
data alias for $1;
table_obj record;
I integer; Begin
i:=0;
for table_obj in execute select * from TABLENAME order by THE_ORDER
loop
update TABLENAME set A = data[i] where B = table_obj.B limit
1;
I := I + 1;
end loop; end; $BODY$
LANGUAGE 'plpgsql' IMMUTABLE STRICT And
call it with: Select
update(?{06959.0,15308.0,15968.0,18916.2,19961.0,26528.0,29553.0,29872.0,30631.0}?) PS:
written code was not tested! Mit
freundlichen Grüßen Timo
Klecker Von: Rajan, Pavithra
[mailto:RAJANP@xxxxxxxxx] Hello ,
Yes -I need to get the exact the same result as you had
listed.Thanks. From: Timo
Klecker [mailto:klecker@xxxxxxxxx] Hello, what
do you expect as Result? Something like this? E.g.
A
B Mit
freundlichen Grüßen Timo
Klecker Von:
pgsql-general-owner@xxxxxxxxxxxxxx [mailto:pgsql-general-owner@xxxxxxxxxxxxxx]
Im Auftrag von Rajan, Pavithra Hello - I have this
table with 90 rows, which contains 2 columns ,column A (type 'numeric') and
column B(type text) . Column 'A' is filled with a constant number and column
'B' has an unique entry for each row. E.g.
A
B
|