41 lines
1.4 KiB
Plaintext
41 lines
1.4 KiB
Plaintext
|
|
ALTER PROCEDURE [dbo].[sp_CalculatedChannelsUpdate]
|
||
|
|
@id int = 0
|
||
|
|
,@Operation int
|
||
|
|
,@CalculatedChannelValueCode nvarchar(255)
|
||
|
|
,@InputChannelIds varbinary(max)
|
||
|
|
,@CFCForInputChannels nvarchar(255)
|
||
|
|
,@CFCForOutput nvarchar(255)
|
||
|
|
,@TestSetupName nvarchar(255) = null
|
||
|
|
,@CCName nvarchar(255)
|
||
|
|
,@ClipLength int
|
||
|
|
,@ViewInRealtime bit
|
||
|
|
,@errorNumber int output
|
||
|
|
,@errorMessage nvarchar(250) output
|
||
|
|
AS
|
||
|
|
BEGIN
|
||
|
|
SET NOCOUNT ON;
|
||
|
|
set @errorNumber = 0
|
||
|
|
set @errorMessage = space(0)
|
||
|
|
|
||
|
|
if(@id = 0 or @Operation is null or @TestSetupName is null)
|
||
|
|
begin
|
||
|
|
RAISERROR(15600,-1,-1, 'sp_CalculatedChannelsUpdate') /* Error 1560 - An invalid parameter or option was specified for procedure*/
|
||
|
|
end
|
||
|
|
else
|
||
|
|
begin
|
||
|
|
declare @TestSetupId int
|
||
|
|
set @TestSetupId = dbo.foo_IdGetTestSetup(@TestSetupName)
|
||
|
|
|
||
|
|
UPDATE [dbo].[CalculatedChannels]
|
||
|
|
SET [Operation] = @Operation
|
||
|
|
,[CalculatedChannelValueCode] = @CalculatedChannelValueCode
|
||
|
|
,[InputChannelIds] = @InputChannelIds
|
||
|
|
,[CFCForInputChannels] = @CFCForInputChannels
|
||
|
|
,[CFCForOutput] = @CFCForOutput
|
||
|
|
,[TestSetupId] = @TestSetupId
|
||
|
|
,[CCName] = @CCName
|
||
|
|
,[ViewInRealtime] = @ViewInRealtime
|
||
|
|
,[ClipLength] = @ClipLength
|
||
|
|
WHERE [Id] = @id
|
||
|
|
end
|
||
|
|
END
|