Skip to content

Instantly share code, notes, and snippets.

@fourgeotf
Last active February 9, 2022 11:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fourgeotf/d9851064b29ef236ce3e616c059a5ecd to your computer and use it in GitHub Desktop.
Save fourgeotf/d9851064b29ef236ce3e616c059a5ecd to your computer and use it in GitHub Desktop.
[CIMPRODUCT - Fonctions Scalaires] Fonctions scalaires #cimproduct #sql #fonctions_scalaires
USE [Cimprod_Mithieux]
GO
/****** Object: UserDefinedFunction [dbo].[F_VerifClotureOF] Script Date: 09/02/2022 11:46:41 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[F_VerifClotureMetaOF] (
@IdMetaOF int
)
RETURNS bit
BEGIN
DECLARE @Result bit
SELECT @Result = MIN(CAST([OF].Cloture AS int)) FROM [OF] WHERE [OF].IdMetaOF = @IdMetaOF GROUP BY [OF].IdMetaOF
RETURN ISNULL(@Result, 0)
END
GO
USE [Cimprod_Mithieux]
GO
/****** Object: UserDefinedFunction [dbo].[F_VerifClotureOF] Script Date: 09/02/2022 12:02:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[F_VerifClotureOF] (
@IdOF int
)
RETURNS bit
BEGIN
DECLARE @Result bit
SELECT @Result = MIN(CAST(OFOperation.Cloture AS int)) FROM OFOperation WHERE OFOperation.IdOF = @IdOF GROUP BY OFOperation.IdOF
RETURN ISNULL(@Result, 0)
END
GO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment