Page 1 of 1

MS SQL Server - "incorrect syntax near" error.

Posted: Wed 02 Nov 2016 10:21
by ertank
Hi,

Using Delphi 10.1 Update 1, UniDAC 6.4.14, MS SQL Server 2012 64bit.

Below is my table structure:

Code: Select all

CREATE TABLE kurlar(
	tarih date NOT NULL,
	kur nvarchar(10) NOT NULL,
	da float NULL,
	ds float NULL,
	ea float NULL,
	es float NULL,
	ckusd float NULL,
	ckdiger float NULL,
	serbest float NULL,
 CONSTRAINT [PK_kurlar] PRIMARY KEY CLUSTERED 
(
	tarih ASC,
	kur ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
I have below SQL which is dislpayed on a DBGrid with Editing allowed.

Code: Select all

select tarih, kur as "Döviz Cinsi", da as "Döviz Alış", ds as "Döviz Satış", ea as "Efektif Alış", es as "Efektif Satış", Serbest as "Serbest Piyasa"
from kurlar 
where tarih = :tarih
I can edit *any* column directly in the grid. When automatically posting (when changing records by arrow keys) I get subject error. Depending on field data type error displayed as:
- Incorrect syntax near "NVARCHAR"
- Incorrect syntax near "FLOAT"

Sample project and sample database backup file including records can be found in below link:
record_edit.7z

I appreciate any solution as I need to fix that pretty fast.

Thanks.

Re: MS SQL Server - "incorrect syntax near" error.

Posted: Wed 02 Nov 2016 23:10
by ertank
I confirm that same error exists in UniDAC 6.4.15

Re: MS SQL Server - "incorrect syntax near" error.

Posted: Thu 03 Nov 2016 10:58
by ViktorV
Thank you for the information. We have reproduced the issue in the Direct Mode and investigation is in progress. We will inform you when we have any results. As a workaround, you can use the standard OLEDB Provider or SQL Native Client Provider. To do this, the UniConnection.SpecificOptions.Values['Provider'] in 'prSQL' or 'prNativeClient' respectively.

Re: MS SQL Server - "incorrect syntax near" error.

Posted: Fri 04 Nov 2016 11:45
by azyk
We have reproduced the described issue and now we are working on its fixing. As soon as the issue is fixed, we will notify you about it and send you a night build with this fix.

Re: MS SQL Server - "incorrect syntax near" error.

Posted: Thu 17 Nov 2016 14:07
by azyk
We fixed this issue. This fix will be included in the next UniDAC build. If you want to get it before the next UniDAC build release, please send the RAD Studio version you are using to andreyz*devart*com and we will send you a night build.

Re: MS SQL Server - "incorrect syntax near" error.

Posted: Tue 22 Nov 2016 17:56
by ertank
Problem fixed at 6.4.16 version.

Thanks.