Files
DP44/DataPRO_sql/dbo.sp_SensorsSquibUpdate.StoredProcedure.sql

103 lines
5.2 KiB
MySQL
Raw Normal View History

2026-04-17 14:55:32 -04:00
<EFBFBD><EFBFBD>IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sp_SensorsSquibUpdate]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[sp_SensorsSquibUpdate]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sp_SensorsSquibUpdate]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[sp_SensorsSquibUpdate] AS'
END
GO
ALTER PROCEDURE [dbo].[sp_SensorsSquibUpdate]
@SerialNumber nvarchar(50) = null
,@BypassCurrentFilter bit
,@BypassVoltageFilter bit
,@DelayMS float
,@DurationMS float
,@FireMode smallint
,@ISOCode nvarchar(50)
,@MeasurementType smallint
,@SquibOutputCurrent float
,@SquibToleranceLow float
,@SquibToleranceHigh float
,@LimitDuration bit
,@ArticleId nvarchar(50)
,@LocalOnly bit
,@Version int
,@LastModified datetime
,@LastModifiedBy nvarchar(50)
,@UserValue1 nvarchar(255)
,@UserValue2 nvarchar(255)
,@UserValue3 nvarchar(255)
,@UserTags varbinary(max)
,@errorNumber int output
,@errorMessage nvarchar(250) output
AS
BEGIN
set @errorNumber = 0
set @errorMessage = space(0)
if(@SerialNumber is null)
begin
set @errorNumber = 1560
set @errorMessage = 'An invalid parameter or option was specified for procedure'
end
else
begin
SET NOCOUNT ON;
UPDATE [dbo].[SensorsSquib]
SET [BypassCurrentFilter] = @BypassCurrentFilter
,[BypassVoltageFilter] = @BypassVoltageFilter
,[DelayMS] = @DelayMS
,[DurationMS] = @DurationMS
,[FireMode] = @FireMode
,[ISOCode] = @ISOCode
,[MeasurementType] = @MeasurementType
,[SquibOutputCurrent] = @SquibOutputCurrent
,[SquibToleranceLow] = @SquibToleranceLow
,[SquibToleranceHigh] = @SquibToleranceHigh
,[LimitDuration] = @LimitDuration
,[ArticleId] = @ArticleId
,[LocalOnly] = @LocalOnly
,[Version] = @Version
,[LastModified] = @LastModified
,[LastModifiedBy] = @LastModifiedBy
,[UserValue1] = @UserValue1
,[UserValue2] = @UserValue2
,[UserValue3] = @UserValue3
,[UserTags] = @UserTags
WHERE [SerialNumber] = @SerialNumber
End
END
GO