Subscribe to this thread
Home - General / All posts - 9.0.168: changes to query syntax
adamw

8,037 post(s)
#07-Aug-18 09:58

Here is a summary of breaking changes to query syntax in the recent update. Queries which use features listed below have to be adjusted to work.

Query parameters use @ as a prefix.

-- Old

EXECUTE WITH (p NVARCHAR = 'folder'[[

  SELECT * FROM mfd_meta WHERE

    StringCompareCollate(property, p, Collate(''falsefalsefalse)) = 0;

]];

 

-- New

EXECUTE WITH (@p NVARCHAR = 'folder'[[

  SELECT * FROM mfd_meta WHERE

    StringCompareCollate(property, @p, Collate(''falsefalsefalse)) = 0;

]];

Function parameters use @ as a prefix.

-- Old

FUNCTION combine(p NVARCHAR, q NVARCHAR) NVARCHAR AS

  p & ': ' & q

END;

SELECT combine(name, type) FROM mfd_root;

 

-- New

FUNCTION combine(@p NVARCHAR, @q NVARCHAR) NVARCHAR AS

 @p & ': ' & @q

END;

SELECT combine(name, type) FROM mfd_root;

EXECUTE requires either query text in [[ ... ]] or the name of an existing query, forms that allow using EXECUTE without leaving the scope of the current query are removed.

-- Old

EXECUTE CALL ValueSequence(1, 10, 1);

 

-- New (uses replacement feature)

TABLE CALL ValueSequence(1, 10, 1);

Expressions for computed fields and constraints use [[ ... ]].

-- Old

CREATE TABLE temp (

  mfd_id INT64, INDEX mfd_id_x BTREE (mfd_id),

  geom GEOM,

  geomarea FLOAT64 AS GeomArea(geom, 0)

);

INSERT INTO temp (geom)

VALUES (GeomMakeRect(VectorMakeX4(0, 0, 10, 10)));

 

-- New

CREATE TABLE temp (

  mfd_id INT64, INDEX mfd_id_x BTREE (mfd_id),

  geom GEOM,

  geomarea FLOAT64 AS [[ GeomArea(geom, 0) ]]

);

INSERT INTO temp (geom)

VALUES (GeomMakeRect(VectorMakeX4(0, 0, 10, 10)));

For more details, see cutting edge threads (eg, the one for 9.0.167.6).

The query builder lists all of the above changes plus new statements (VALUE, TABLE, SCRIPT) plus new functions.

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