Page 1 of 1

error formatting valid SQL

Posted: Thu 07 Dec 2017 16:53
Hi,
When I try to format the below SQL using "Format Document", I get a couple errors:
Error (5,41): '','' expected
Error (14,41): '')'' expected

This is valid SQL that runs fine, but SQL Complete is unable to format it for some reason. Here's the SQL:

Code: Select all

SELECT
	p.Id AS [datasetItemId],
	p.HashKeyId AS [hashKeyId],
	(
		SELECT
			geography::UnionAggregate(l.geography)
		FROM Location pod
		WHERE l.PlaceId = p.Id
	) AS geography,
	(
		SELECT
			p.Id,
			p.FileNumber,
			p.Owner,
			p.Type,
			p.Status,
			p.SurfaceSubBasin,
			p.GroundWaterBasin,
			p.LinkToSummary,
			p.HashKeyId,
			ISNULL(JSON_QUERY(
					(
						SELECT
							l.Id,
							l.PlaceId,
							l.NameOrNumber,
							l.Status,
							l.GroundWaterSource,
							l.DepthOfWellFeet,
							l.DepthToWaterFeet,
							l.UTMSource,
							l.UTMAccuracy,
							l.OtherLocation,
							l.LocationError,
							l.LinkToSummary,
							l.Geography.STAsText() AS Geography
						FROM dbo.Location l 
						WHERE l.PlaceId = p.Id
						FOR JSON PATH
					)
				), '[]') AS Locations
		FOR JSON PATH, WITHOUT_ARRAY_WRAPPER, INCLUDE_NULL_VALUES
	) AS datasetItem
FROM dbo.Place p

Re: error formatting valid SQL

Posted: Fri 08 Dec 2017 16:26
by alexa
We will investigate this issue and will answer you as soon as possible.

Re: error formatting valid SQL

Posted: Mon 11 Dec 2017 11:08
by alexa
We will fix this issue in one of the next product builds and will notify you once it's available for downloading.

Re: error formatting valid SQL

Posted: Mon 11 Dec 2017 16:25
Thank you.

Re: error formatting valid SQL

Posted: Fri 09 Feb 2018 09:34
by AlexandrS
Hello!

Hope this email finds you well,

Just following up on the ticket and want to inform you that there is a new version of SQL Complete available.

You can download it from: https://www.devart.com/dbforge/sql/sqlc ... nload.html

Best regards,
Alexander Sergeev
Devart Team
http://www.devart.com