简体   繁体   中英

How to get Output parameter from SQL query in F#

I have SQL query, where I have two parameters and one output parameter (varchar). How I should call the procedure and get the output parameter? Thanks.

First of all you have to connect to your db. What technology are you using?

In any case it could be something like that (code is written for c# & Oracle, but it will give you an idea how to solve your case):

IDbConnection dbConnection = new OracleConnection(your_connectionstring)
var param = new OracleDyamicParameters(); 
param.Add("out_result", OracleDbType.Int64, ParameterDirection.Output);
string query = "Your_proc_Name";
await SqlMapper.QueryAsync<MyReturnClass>(dbConnection, query, param: param, commandType: CommandType.StoredProcedure);
db_res.Result = param.GetOutResult();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM