B
BFSmith
I have a sp that has one input parameter (Piece char(7)) and one output
parameter (Cost )...the sp works fine but I can't figure out how to:
a) get the sp to run in ip
b) I really need the OUTPUT parameter
sp: PROCEDURE dbo.prGetPieceReprocCost (
@Piece char(7),
@Cost smallmoney = null output
)
Both Piece & Cost are in the main data source.
My code so far is:
function btnReproc::OnClick(eventObj)
{
//Retrieve the value of the field that you want to use as a parameter
//to the stored procedure.
var sPiece =
getNodeValue("/dfs:myFields/dfs:dataFields/d:tblRAHeader/d:tblRADetail/@Piece");
XDocument.UI.Alert(sPiece);
//Set the Command for the Query Adapter of the Data Source. Incorporate the
//parameter values that you want to use.
var retCost = 0
var strSQL = 'execute "prGetPieceReprocCost" ' + '"' + sPiece + '"' + '
,retCost output';
XDocument.UI.Alert(strSQL);
XDocument.QueryAdapter.Command = strSQL;
//Query the Data Source.
XDocument.Query();
The strSQL is : execute "prGetPieceReprocCost" "447359M" ,retCost output
and I get : Cannot use the OUTPUT option when passing a constant to a stored
procedure
parameter (Cost )...the sp works fine but I can't figure out how to:
a) get the sp to run in ip
b) I really need the OUTPUT parameter
sp: PROCEDURE dbo.prGetPieceReprocCost (
@Piece char(7),
@Cost smallmoney = null output
)
Both Piece & Cost are in the main data source.
My code so far is:
function btnReproc::OnClick(eventObj)
{
//Retrieve the value of the field that you want to use as a parameter
//to the stored procedure.
var sPiece =
getNodeValue("/dfs:myFields/dfs:dataFields/d:tblRAHeader/d:tblRADetail/@Piece");
XDocument.UI.Alert(sPiece);
//Set the Command for the Query Adapter of the Data Source. Incorporate the
//parameter values that you want to use.
var retCost = 0
var strSQL = 'execute "prGetPieceReprocCost" ' + '"' + sPiece + '"' + '
,retCost output';
XDocument.UI.Alert(strSQL);
XDocument.QueryAdapter.Command = strSQL;
//Query the Data Source.
XDocument.Query();
The strSQL is : execute "prGetPieceReprocCost" "447359M" ,retCost output
and I get : Cannot use the OUTPUT option when passing a constant to a stored
procedure