Skip to content

NamedStoredProcedureQuery not supporting IN parameters with DB2 #3165

@javatype

Description

@javatype

Hi,

My Procedure call was working fine before spring upgrade.

I am using below dependencies -
org.springframework.boot:spring-boot-starter-data-jpa🫙3.1.3, with which getting
jakarta.persistence:jakarta.persistence-api:jar:3.1.0

@Entity
@NamedStoredProcedureQuery(name = "myProcc",
        procedureName = "MYPROC",
        parameters = {
                @StoredProcedureParameter(mode = ParameterMode.IN, name = "KEYTYPE", type = String.class),
                @StoredProcedureParameter(mode = ParameterMode.OUT, name = "SOME_ID", type = Long.class)
        })
public class MyGenerationEntity {
  @Id
  @Column(name = "SOME_ID")
  Long keyType;
}

@Repository
public interface MyRepository extends JpaRepository<MyGenerationEntity, Long>{
  @Procedure(name = "myProcc", outputParameterName = "SOME_ID")
  @Transactional
  Long getKey(@Param("KEYTYPE") String keyType);
}

Now, when I call this in code, I am getting below exception.
Db is DB2.

 Error Detail:Unexpected character ':' found in FLOAT literal.  Full SQL statement text
= call MYPROC(:KEYTYPE,:SOME_ID)  ERRORCODE=-4463, SQLSTATE=42601] [{call MYPROC(:KEYTYPE,:SOME_ID)}];

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions