日期:2014-05-18 浏览次数:20540 次
SET @V_TMP_SQL_CUR='FETCH NEXT FROM CUR_SCR_SGMNT_'+@V_BTCH_EXAM_ID+' into @V_SGMNT_ID,@LWR_SCR,@LWR_CNDTN,@LMT_SCR,@LMT_CNDTN,@V_SGMNT_NM ' PRINT @V_TMP_SQL_CUR EXEC sp_executesql @V_TMP_SQL_CUR,N'@V_SGMNT_ID NVARCHAR(40),@LWR_SCR DECIMAL(10,2),@LWR_CNDTN NVARCHAR(40),@LMT_SCR DECIMAL(10,2),@LMT_CNDTN NVARCHAR(40),@V_SGMNT_NM NVARCHAR(100) OUT',@V_SGMNT_ID,@LWR_SCR,@LWR_CNDTN,@LMT_SCR,@LMT_CNDTN,@V_SGMNT_NM OUTPUT SET @k = @k+1; PRINT '打印:@V_SGMNT_ID ='+@V_SGMNT_ID PRINT @V_SQL_STR IF (@k = 1) BEGIN SET @V_SQL_STR = @V_SQL_STR+'( CASE ' SET @V_SQL_SGMNT_NM = @V_SQL_SGMNT_NM+'( CASE ' END PRINT 'k'+CAST(@k AS VARCHAR(10))+'>>>>>>@V_SQL_STR='+ISNULL(@V_SQL_STR,'NULL') PRINT 'k'+CAST(@k AS VARCHAR(10))+'>>>>>>@V_SQL_SGMNT_NM='++ISNULL(@V_SQL_STR,'NULL') ……