Skip to content

stored procedure call doesnt work without brackets {} #2631

Open
@DmitriyGod

Description

@DmitriyGod

Driver version

latest

SQL Server version

mcr.microsoft.com/mssql/server:2022-latest

Client Operating System

any

JAVA/JVM version

any

Table schema

create procedure test_bigdecimal
@big_decimal_type      decimal(15, 5)       ,
@big_decimal_type_o    decimal(15, 5) output
as begin
   set @big_decimal_type_o = @big_decimal_type;
end;

Problem description

Hi! MSSQL driver don't allow to use prepareCall without brackets {}

Expected behavior

Like in pg, oracle, hsqldb, mariadb, mysql, snowflake, db2,
code below shouldn't cause exception:

var call = connection.prepareCall("""
    call test_bigdecimal(100.24112, ?)""");

call.registerOutParameter(1, Types.DECIMAL);
call.execute();

Actual behavior

prepareCall works only with brackets
var call = connection.prepareCall("""
    {call test_bigdecimal(100.24112, ?)}""");
call.registerOutParameter(1, Types.DECIMAL);
call.execute();

Error message/stack trace

Incorrect syntax near '@p0'

Any other details that can be helpful

JDBC trace logs

Metadata

Metadata

Labels

BacklogThe topic in question has been recognized and added to development backlogEnhancementAn enhancement to the driver. Lower priority than bugs.

Type

No type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions