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