-- ================================================ -- Template generated from Template Explorer using: -- Create Inline Function (New Menu).SQL -- -- Use the Specify Values for Template Parameters -- command (Ctrl-Shift-M) to fill in the parameter -- values below. -- -- This block of comments will not be included in -- the definition of the function. -- ================================================ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- ============================================= -- Author: -- Create date: -- Description: -- ============================================= CREATE PROCEDURE PIConjuntiveRatio ( -- Add the parameters for the function here @par1 VARCHAR(50), @par2 VARCHAR(50), @par3 VARCHAR(50), @par4 VARCHAR(50) ) AS BEGIN DECLARE @PIRatio REAL; DECLARE @PI INT; DECLARE @NonNull INT; -- Add the SELECT statement with parameter references here EXEC NumberOfConjuntivePI @par1, @par2, @par3, @par4; SELECT @PI = value FROM ConjuntivePI WHERE name='ConjuntivePI'; EXEC @NonNull = NonNullAiAjAkAh @par1, @par2, @par3, @par4; SELECT @NonNull = value FROM ConjNonNull WHERE name='ConjNonNull'; SET @PIRatio = 0; IF(@NonNull<>0) SET @PIRatio = CAST(@PI AS REAL)/CAST(@NonNull AS REAL); --PRINT @PIRatio IF ((SELECT count(name) FROM sys.tables WHERE name='PIConjRatio')=1) DROP TABLE PIConjRatio; CREATE TABLE PIConjRatio(name varchar(50) primary key, value REAL); INSERT INTO PIConjRatio VALUES ('PIConjRatio', @PIRatio); --RETURN @PIRatio; END; GO