Home > Archive > PostgreSQL SQL > December 2006 > Query for block updates









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Query for block updates
Amit Shah

2006-12-04, 12:14 am

Hi,

If this question doesn't belong to this mailing list, please pardon.

I have a table with a few hundred million rows, and I need to write a query
that does something like follows --

Change all the values of a column to null where the value cannot be casted to
numeric(20,4)

I have it as varchar, and I need to convert it to numeric(20,4).

I am using this query - alter table optiondata ALTER volume TYPE numeric(20,4)
using cast(volume as numeric(20,4)); then wait for DB to complain, and then
update that value to null, and just keep doing this till all garbadge is
removed :-(

Thanks,
Amit

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com