Files
DP44/DataPRO/Modules/Database/DatabaseMigrationScripts/.svn/pristine/8b/8b797b905ff20839bd52de5194f2f86e141173d4.svn-base

64 lines
2.0 KiB
Plaintext
Raw Permalink Normal View History

2026-04-17 14:55:32 -04:00
ALTER PROCEDURE [dbo].[sp_CalculatedChannelsUpdateInsert]
@id int = 0
,@Operation int
,@CalculatedChannelValueCode nvarchar(255)
,@InputChannelIds varbinary(max)
,@CFCForInputChannels nvarchar(255)
,@CFCForOutput nvarchar(255)
,@TestSetupName nvarchar(255)
,@CCName nvarchar(255)
,@ClipLength int
,@ViewInRealtime bit
,@new_id int OUTPUT
,@errorNumber int output
,@errorMessage nvarchar(250) output
AS
BEGIN
SET NOCOUNT ON;
set @errorNumber = 0
set @errorMessage = space(0)
if(@Operation is null or @TestSetupName is null)
begin
RAISERROR(15600,-1,-1, 'sp_CalculatedChannelsUpdateInsert') /* Error 1560 - An invalid parameter or option was specified for procedure*/
end
else
begin
declare @TestSetupId int
set @TestSetupId = dbo.foo_IdGetTestSetup(@TestSetupName)
if(@id != 0 and exists(select Id from [dbo].[CalculatedChannels] where Id = @id and TestSetupId = @TestSetupId))
begin
set @new_id = @id
exec [dbo].[sp_CalculatedChannelsUpdate] @id
,@Operation
,@CalculatedChannelValueCode
,@InputChannelIds
,@CFCForInputChannels
,@CFCForOutput
,@TestSetupName
,@CCName
,@ClipLength
,@ViewInRealtime
,@errorNumber output
,@errorMessage output
end
else
begin
exec [dbo].[sp_CalculatedChannelsInsert] @Operation
,@CalculatedChannelValueCode
,@InputChannelIds
,@CFCForInputChannels
,@CFCForOutput
,@TestSetupName
,@CCName
,@ViewInRealtime
,@ClipLength
,@new_id OUTPUT
,@errorNumber output
,@errorMessage output
end
end
END