-
-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: calling stored procedure which returns values #426
Comments
This code works for SqlConnection and such. With SqlConnection, Sql Drivers are directly used, so it supports native SQL Server queries, by using variables (they start with a At the moment, this works only for SqlConnection. I am working on OleDb, ODBC and Oracle Connection here: #423. At the end of the day, SQL server extensions will work for nearly anything. The only exception will be for the save operator that won't work for anything else than Sql Server (at least for now) |
@paillave, thank you. What about the first part of the question. Is there a way to get output of the stored procedure into output stream if that stored procedure returns anything? |
Normaly, using SQL server connection, an exec statement should do it from a [...]
contextStream
.CrossApplySqlServerQuery("get people", o => o
.FromQuery("exec sp_getPeople @value1, @value2")
.WithMapping(i => new
{
Name = i.ToColumn("FirstName"),
Birthday = i.ToDateColumn("DateOfBirth")
}));
[...] |
@paillave thanks for explaining this, I assume this could be as a part of documentation as based on example provided there, it looks like ToSqlCommand is the only way to use it. I will close this. |
I will reopen it as a documentation ticket. Like most of opened ticket here, I will close them once their content is in the documentation. |
Reviewed documentation on calling stored procedures and SQL commands, and I would like to know:
ToSqlCommand always returns the input events as is.
;ToSqlCommand
has variable declarations like:How we could use @ within, isn't it reserved for parameter injection from upper stream? Checked the code, and its a bit strange to use @ for params, as @ is used in MS SQL for variable definitions and @@ for system variables as well.
The text was updated successfully, but these errors were encountered: