Further to my previous post on query conversion (8 to 9), I have used the following series of queries in Manifold 8 in many projects. The purpose is simply to place buffers areas (circles) in Stbck-RPV Drawing centred on points in RPV Drawing with a different size buffer for the [RPVQ] field values in [RPV Table] which are 'R's (noise Receptors), 'V's (vacant lot surrogate receptors) or 'P's (participants). R's and V's get the same (550 m) setback. ' Generate setback buffers ' initialize - delete all setback buffers from Stbck-RPV table/drawing DELETE FROM [Stbck-RPV Table] ' generate 550 m setback from R's and V's INSERT INTO [Stbck-RPV Table]([Geom (I)]) ( SELECT Buffer([RPV].[Geom (I)],550.0) FROM [RPV Table] AS [RPV] WHERE [RPV].[RPVQ] = "R" OR [RPV].[RPVQ] = "V" ) ' generate 275 m setback from P's. Note: No setback from Q's INSERT INTO [Stbck-RPV Table]([Geom (I)]) ( SELECT Buffer([RPV].[Geom (I)],275.0) FROM [RPV Table] AS [RPV] WHERE [RPV].[RPVQ] = "P" ) After everyone's very helpful discussion regarding the 8-to-9 conversion of UPDATE queries and some experimentation, I got the following queries to work in 9 as desired. -- generate setback buffers -- initialize - delete all setback buffers from Stbck-RPV table/drawing DELETE FROM [Stbck-RPV Table] ; -- generate 550 m setback from R's and V's INSERT INTO [Stbck-RPV Table] SELECT [mfd_id], GeomBuffer([RPV].[Geom],550.0,0) FROM [RPV Table] as [RPV] WHERE ([RPV].[RPVQ]='R') OR ([RPV].[RPVQ]='V') ; -- generate 275 m setback from P's. Note: No setback from Q's INSERT INTO [Stbck-RPV Table] SELECT [mfd_id], GeomBuffer([RPV].[Geom],275.0,0) FROM [RPV Table] as [RPV] WHERE ([RPV].[RPVQ]='P') ; So, my question is not how to make it work but to ask for a clarification. In the above, it seems that I'm forcing the index ([mfd_id]) from the [RPV Table] to be the index in the [Stbck-RPV Table]. If this is really the case, it doesn't seem (to me) that this would be good practice (or perhaps it is?). Wouldn't it be better to let the query generate its own index numbers for the [Stbck-RPV Table], one for each new Geom inserted? And if so, how would I go about enabling that? Many thanks for any insight that anyone can provide. Cheers, Jim
|