Skip to content

Delimited identifiers cannot be used as bind parameters #1405

@mipo256

Description

@mipo256

Spring-data-jdbc seems to have a problem with persisting values for columns with quotation marks enclosed. I have specifically created a PR for this issue just to demonstrate the problem. This PR contains only the test that fails. For example, we have table in ibm db2:

CREATE TABLE WITH_DELIMITED_COLUMN
(
    ID                      BIGINT AUTO_INCREMENT PRIMARY KEY,
    "ORG.XTUNIT.IDENTIFIER" VARCHAR(100),
    STYPE                   VARCHAR(100)
);

Notice the second column quoted. So, this quotation marks are not a part of the column name itself, and spring data generates the query:

INSERT INTO "WITH_DELIMITED_COLUMN" ("ORG.XTUNIT.IDENTIFIER", "STYPE") VALUES (?, ?);

It will work, but the problem seems to be that spring does not substitute the value for ORG.XTUNIT.IDENTIFIER, and we get null in the column ORG.XTUNIT.IDENTIFIER as a result of this insert, even though the value was provided to the framework.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions