EXEMPLO_1212310
Database
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
FUNC_RETORNAINSTANCIA
Parameters
Name
Type
Mode
Definition
CREATE FUNCTION FUNC_RETORNAINSTANCIA() RETURNS VARCHAR(02) AS BEGIN DECLARE @INSTANCIA VARCHAR(02) SELECT @INSTANCIA = VALORSTR FROM HCPARAMETROS WHERE NOMECOLUNA LIKE 'KPI_INSTANCIA' AND CODCOLIGADA = 0 /* Retorna o valor default caso o parâmetro não tenha sido atribuido */ IF @INSTANCIA IS NULL OR LTRIM(RTRIM(@INSTANCIA)) = '' BEGIN SET @INSTANCIA = '01' END RETURN @INSTANCIA END