<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16414" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=156150511-05062007><FONT face=Arial
color=#0000ff size=2>You seem to be missing some join clauses here so your query
looks like it would be trying to update a cartesian product of records which
could be huge depending on the number of records you are talking about in each
table. Basically would be (a number of records) * (b number of records) *
(obj_cadangan_oil number of records)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=156150511-05062007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=156150511-05062007><FONT face=Arial
color=#0000ff size=2>What is the connection between the table obj_cadangan_oil
and the other tables - because the below at best will set all records to the
same value. If that is your intension, then that would be
fine.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=156150511-05062007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=156150511-05062007><FONT face=Arial
color=#0000ff size=2>I think your statement should be something
like</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=156150511-05062007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=156150511-05062007><FONT face=Arial
color=#0000ff size=2>UPDATE obj_cadangan_oil</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=156150511-05062007> <FONT
face=Arial color=#0000ff size=2>SET working_area =
m.block_name</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=156150511-05062007><FONT face=Arial
color=#0000ff size=2>FROM <FONT face="Times New Roman" color=#000000
size=3>(select block_name, (maybe some other field here you will use to
join) FROM map_field a, map_petroleum_contract_area b where
intersects(a.the_geom,b.the_geom) and b.the_geom ~ a.the_geom) As
m</FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=156150511-05062007>WHERE
obj_cadangan_oil.something = m.something or some spatial condition</SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=156150511-05062007></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=156150511-05062007><FONT face=Arial
color=#0000ff size=2>Hope that helps,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=156150511-05062007><FONT face=Arial
color=#0000ff size=2>Regina</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B>
postgis-users-bounces@postgis.refractions.net
[mailto:postgis-users-bounces@postgis.refractions.net] <B>On Behalf Of </B>Bayu
Kurniawan R<BR><B>Sent:</B> Tuesday, June 05, 2007 2:47 AM<BR><B>To:</B>
postgis-users@postgis.refractions.net<BR><B>Subject:</B> [postgis-users] update
a table<BR></FONT><BR></DIV>
<DIV></DIV>i want update a table, <BR><BR>when i want to update, a wrote sql
like :<BR><BR>UPDATE obj_cadangan_oil set working_area=(select block_name where
intersects(a.the_geom,b.the_geom) and b.the_geom ~ a.the_geom) <BR>FROM
map_field a, map_petroleum_contract_area b; <BR><BR>it's above query is right
???, <BR>why it's take a long time to query<BR clear=all><BR>-- <BR>Bayu
Kurniawan R<BR>GIS Programmer<BR>PT. Sigma Cipta Utama<BR>Jl. Tekno I Blok B
No:5,6,7<BR>BSD City Tangerang 15314 <BR>Indonesia<BR></BODY></HTML>
<HTML><BODY><P><hr size=1></P>
<P><STRONG>
The substance of this message, including any attachments, may be confidential, legally privileged and/or exempt from disclosure pursuant to Massachusetts law. It is intended solely for the addressee. If you received this in error, please contact the sender and delete the material from any computer.
</STRONG></P></BODY></HTML>