How to pass null/None to Procedure?

Open
#158 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
fsharp, sql
Domain
databases

Research direction

Start with the SQL procedure definition and the F# call db.Procedures.test.Invoke(None), then inspect how the procedure parameter type is generated. Reproduce the reported type error and determine whether the optional SQL parameter can be passed as shown. Done means the null value is accepted and the procedure returns its result set.

Written by the indexing model from the issue text.

Description

bug
CREATE PROCEDURE dbo.test (
    @OptionalParam INT = NULL
)
AS 

SELECT 1
//Snip...
[ for r in db.Procedures.test.Invoke(None).ResultSet
                  -> r.MapTo<TestResult> () ]
//Error: Expression was expected to have type int but here has type Option<int>
Dominant language
F#
Stars
627
Forks
147
Avg merge
2h 2m
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

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.

More from fsprojects/SQLProvider

All issues in fsprojects/SQLProvider

Similar issues

More Databases issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.