EXEMPLO_1212310
Database
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
FUNC_TABELAPARAMETROS
Parameters
Name
Type
Mode
@NOMEPARAM
varchar
IN
Definition
CREATE FUNCTION FUNC_TABELAPARAMETROS ( @NOMEPARAM VARCHAR(MAX) ) RETURNS @PARAMETROS TABLE ( PARAMVALUE VARCHAR(MAX) ) AS BEGIN DECLARE @PARAM VARCHAR(MAX) DECLARE @SPLITON VARCHAR(1) DECLARE @CONT INT DECLARE @VALUE VARCHAR(MAX) SELECT @PARAM = VALORSTR FROM HCPARAMETROS WHERE NOMECOLUNA LIKE @NOMEPARAM SET @CONT = 1 SET @SPLITON = ';' WHILE (CharIndex(@SPLITON, @PARAM) > 0) BEGIN SELECT @VALUE = Ltrim(Rtrim(SubString(@PARAM, 1, CharIndex(@SPLITON, @PARAM) - 1))) SET @PARAM = SubString(@PARAM, CharIndex(@SPLITON, @PARAM) + 1, Len(@PARAM)) SET @CONT = @CONT + 1 END SET @VALUE = LTRIM(RTRIM(@PARAM)) INSERT @PARAMETROS SELECT @VALUE RETURN END