1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
SET @LES = (SELECT FDILABEL From VLBSA_CCTRL_ATTRIBUTE_FIELD_LIST WHERE FLDNAME = @valeur_rechercher)
print @LES
SET @Tol_max = (SELECT FLDNAME From VLBSA_CCTRL_ATTRIBUTE_FIELD_LIST WHERE FDILABEL = 'Tol '+ @LES +' max')
print @Tol_max
SET @Tol_min = (SELECT FLDNAME From VLBSA_CCTRL_ATTRIBUTE_FIELD_LIST WHERE FDILABEL = 'Tol '+ @LES +' min')
print @Tol_min
SET @sqlCommand = 'SELECT '+ @valeur_rechercher+' FROM VLBSA_CCTRL_GCO_GOOD_ATTRIBUTE'
SET @sqlCommand = @sqlCommand + ' WHERE ' + @col_name + ' = '+ ''''+@id_article+''''
--EXEC(@sqlCommand)
SELECT @sqlCommand
SET @sqlCommand_max = 'SELECT '+ @Tol_max+' FROM VLBSA_CCTRL_GCO_GOOD_ATTRIBUTE'
SET @sqlCommand_max = @sqlCommand_max + ' WHERE ' + @col_name + ' = '+ ''''+@id_article+''''
-- EXEC(@sqlCommand_max )
SET @sqlCommand_min = 'SELECT '+ @Tol_min+' FROM VLBSA_CCTRL_GCO_GOOD_ATTRIBUTE'
SET @sqlCommand_min = @sqlCommand_min + ' WHERE ' + @col_name + ' = '+ ''''+@id_article+''''
-- EXEC(@sqlCommand_min )
create TABLE #T(test_min nvarchar(30),test_cible nvarchar(30), test_max nvarchar(30))
insert into #T
EXEC (@sqlCommand_min,@sqlCommand,@sqlCommand_max); |
Partager