Files
DP44/DataPRO/Modules/Database/DatabaseMigrationScripts/.svn/pristine/52/520ca7b842eb50ca88f3689a642abb0850eeadf0.svn-base

58 lines
1.6 KiB
Plaintext
Raw Normal View History

2026-04-17 14:55:32 -04:00
ALTER PROCEDURE [dbo].[sp_CalculatedChannelsInsert]
@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
set @errorMessage = 'sp_CalculatedChannelsInsert: Error 1560 - An invalid parameter or option was specified for procedure'
set @errorNumber = 1560
end
else
begin
begin try
declare @TestSetupId int
set @TestSetupId = dbo.foo_IdGetTestSetup(@TestSetupName)
INSERT INTO [dbo].[CalculatedChannels]
([Operation]
,[CalculatedChannelValueCode]
,[InputChannelIds]
,[CFCForInputChannels]
,[CFCForOutput]
,[TestSetupId]
,[CCName]
,[ViewInRealtime]
,[ClipLength])
VALUES
(@Operation
,@CalculatedChannelValueCode
,@InputChannelIds
,@CFCForInputChannels
,@CFCForOutput
,@TestSetupId
,@CCName
,@ViewInRealtime
,@ClipLength)
set @new_id = scope_identity();
end try
begin catch
set @errorMessage = error_message()
set @errorNumber = error_number()
end catch
end
END