spring-projects / spring-projects/spring-framework

Support optional parameters in stored procedures

Open
#27,322 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

in: data status: pending-design-work type: enhancement
Dominant language
Java
Stars
60.2k
Forks
38.8k
Avg merge
5d 2h
Merged PRs (30d)
27

Description

As per https://stackoverflow.com/questions/13162043/spring-simplejdbccall-default-optional-arguments there seems to be no straightforward way to call stored procedure with optional parameters.

I would expect there to be something like SqlDefaultParamaterValue for explicit binding to default value (in SQL Server this would generate DEFAULT).
Additionally SimpleJdbcCall should do it automatically for missing parameters based on metadata (COLUMN_DEF)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the SimpleJdbcCall entry point and the stored-procedure parameter metadata described in the issue. Review the referenced Stack Overflow example and SQL Server's DEFAULT behavior, then define how explicit default binding and missing parameters from COLUMN_DEF should work. Done means optional parameters can be called without supplying values while preserving existing calls.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, sql
Domain
database
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.