0

I have gone through lot of tutorials on the web on how to create a stored procedure. I understand that to use a procedure, syntax is "Call procedure_name(in parameters)". But i have found no appreciable example for stored procedure which have multiple output parameters. Could you please give me an example of procedure with out parameters and how to use(call/handle the out parameters) that? Can the output parameters be a table/view type?

Help would be greatly appreciated.

Thanks in advance

-Adithya

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
pythonguy
  • 46
  • 4
  • 1
    Please, clarify the question: what do you mean by *use*? You can use it in subsequent procedure call, as call resultset or as table variable itself. To call procedure you need just `call proc( param1 => param_value1, param2 => param_value2)` no matter what the parameter is: table variable, scalar variable, in or out (of course, with restriction that out parameter need to be writable). You can check the [SQLScript documentation](https://help.sap.com/viewer/de2486ee947e43e684d39702027f8a94/2.0.03/en-US/49f6c42ccdc942ab9dddd5170a49edad.html) for overview of what can and what cannot be a parameter – astentx Mar 18 '21 at 22:14

1 Answers1

0

Execute the proc:

myMultiProc.ExecuteNonQuery();

use the Parameters .Value to get each output parameter:

string strOut1 = myMultiProc.Parameters["@Output1"].Value; string strOut2 = myMultiProc.Parameters["@Output2"].Value;