#1 Today 10:42:28

itSDS
Member
From: Germany
Registered: 2014-04-24
Posts: 604

Regression in mormot.db.sql

Im Using "multiStatements" in my Query

Sample:

create table #tmp_ids_FAB4C3C346934CB884E2FAB4B5F0E444 (TempID bigint primary key);
declare @csvids nvarchar(max) = '''';
INSERT INTO #tmp_ids_FAB4C3C346934CB884E2FAB4B5F0E444 (tempid) SELECT CAST([value] AS bigint) FROM OPENJSON(''['' + @csvids + '']'');
select distinct(hd.referenzid) f0 from ha_doku hd inner join #tmp_ids_FAB4C3C346934CB884E2FAB4B5F0E444 t on t.tempid = hd.referenzid where (hd.referenz = :("auftraege"):) and (hd.werteart = :("Photo"):);

You made a change in mormot.db.sql.pas from 15085 to 15115 (Dont now exact which commit)

i patched it replacing the new TReplaceSQL and DoSQLReplace with the old code from 15085 so that ReplaceParamsByNames / ReplaceParamsByNumbers are restored.

The Error Message Displayed is: (MSSQL)

Im Projekt xyz.exe ist eine Exception der Klasse ESqlDBDataset mit der Meldung TSq|DBUniDACStatement.ExecutePrepared expected 0 bound parameters, got 2


Rad Studio 12.3 Athens / 13.0 Ganymede

Offline

#2 Today 13:52:22

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,515
Website

Re: Regression in mormot.db.sql

I tried to reproduce your issue with
https://github.com/synopse/mORMot2/commit/eb473e1ce

But it seems to process correctly the input, and find 2 parameters.

Can you debug a bit more, and check what is the ReplaceParamsByNames() input?
I am not sure ReplaceParamsByNames() is the culprit.

Offline

Board footer

Powered by FluxBB