Subscribe to this thread
Home - General / All posts - Simple syntax error
rk
645 post(s)
#03-Apr-24 08:29

Trick question?

Why does running this gives 'Cannot parse query' error? And how to fix it?

SELECT 

 GeomMakePoint(VectorMakeX2(mfd_id,mfd_id)) as geom

FROM

 [mfd_root]

It took longer than nice time to figure this out.

rk
645 post(s)
#03-Apr-24 08:31

This forum's syntax highlighting gives more hints than query window inside M9

yves61
451 post(s)
#03-Apr-24 11:51

If you delete 'as geom' the query runs fine --> the geom field gets auto field name 'result'.

If you replace 'as geom' with 'as a' the query runs fine too.

My understanding : 'geom' is kind of reserved name in your initial query, thus throwing an error ?

Using a double quote around geom , thus like ... as "geom" ... runs fine too !

artlembo


3,425 post(s)
online
#03-Apr-24 12:40

you can use AS [geom], so that you'll have a field name called geom.

And Rivo, yes, sadly you are correct the lack of syntax highlighting in M9 is a real bummer, especially after all this time...

Manifold User Community Use Agreement Copyright (C) 2007-2021 Manifold Software Limited. All rights reserved.