Skip to content

[BUG] MSSQL Safe SQL Parameter Not Working #3799

@alexwijoyo

Description

@alexwijoyo

Description

When I run query using safe SQL parameter, I got Incorrect syntax near '?'.

Steps to reproduce

  1. Create Safe parameterized select statement using MSSQL Resource
  2. Click on Save
  3. Clic on Run
  4. You will get run action error: mssql: Incorrect syntax near '?'.
  5. Sent SQL:
    exec sp_executesql N'select der.*
    from DailyExchangeRate der
    where der.SrcCurrencyId<>''USD'' and
    Date between ? and ?',N'@p1 nvarchar(max),@p2 nvarchar(max)',@p1=N'',@p2=N''
  6. Should be:
    exec sp_executesql N'select der.*
    from DailyExchangeRate der
    where der.SrcCurrencyId<>''USD'' and
    Date between @p1 and @p2',N'@p1 nvarchar(10),@p2 nvarchar(10)',@p1=N'2024-03-01',@p2=N'2024-07-31'

Version

self-host

ILLA Builder Version

latest

Browser

No response

Operating System

  • macOS
  • Windows
  • Linux

Additional Information

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions