question

diniappani avatar image
diniappani asked

Calling a stored procedure in a SELECT statement

How do I call a stored procedure in a select statement with input parameters? [link text][1] Attached is the SELECT statement and the stored procedure. [1]: /storage/temp/ 3267-question.txt
stored-procedures
question.txt (1.6 KiB)
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Button avatar image
Button answered
If you say you want to call a stored procedure in a select statement, will the stored procedure return only one value per call(row item returned by the select)? Saying that there won't be 1 to many, but 1 to 1. If it is a 1 to 1 situation you could look at creating a function that can accept variables and pass back your result that you want and will do it per row returned in your select. Look at [Create Function][1] for a base understanding on functions. [1]: https://msdn.microsoft.com/en-za/library/ms186755.aspx
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

diniappani avatar image diniappani commented ·
Again in the stored procedure i am calling another executeCmd, which is not supported in the function. Can i resolve this by using Stored proc
0 Likes 0 ·
Button avatar image Button diniappani commented ·
Calling a stored proc in a stored proc could be an option if I understand what you want to do correctly. Let me know what worked for you.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.