Hi,

I've got a Stored Procedure that functions as designed. However, when I call
it from a CF template, my cfProcParam, an output variable that I wish to
display, seems to be ignored. Here is my CF code:

<!--- begin cf code --->
<cfstoredproc datasource="WEDGETEST" procedure="UpdateTraining">
   <cfProcParam cfsqltype="CF_SQL_VARCHAR" type=Out variable="ReturnMsg"
dbvarname="@RetMsg">
</cfstoredproc>

<cfoutput>#ReturnMsg#</cfoutput>
<!--- end cf code -->

Unfortunately, ReturnMsg is not displayed, thought the code is executed.
ReturnMsg is the value of @RetMsg, shown in an excerpt of the StoredProc
below:

/**** begin transact sql code ****/
ALTER   PROCEDURE dbo.UpdateTraining
(       @RetVal int = NULL Output,
        @RetMsg nvarchar(255)= NULL Output)
as
        -- Declare @ReturnMsg   nvarchar(255)

DELETE FROM SCO510 WHERE AGENCY_NO BETWEEN 701 AND 710
select @RetMsg = 'Deleted From 510 ' + CONVERT(varchar(5), @@RowCount) + '
rows.'

UPDATE AGENCY_PKG_RECTYPE SET STATUS = 'Empty' where AGENCY_NO BETWEEN 701
AND 710
select @RetMsg = @RetMsg + 'Updated ' + CONVERT(varchar(5), @@RowCount) + '
rows to Empty in RecType table.'

print @RetMsg
/**** end transact sql code ****/

In the Stored Proc itself, @RetMsg is displayed using the Print command. Do
I have to somehow RETURN the value so that CF sees it? I've looked at the
Return command in SQL Server but it does something different entirely.

Thanks in advance.
Andrew

______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to