Delimiter //
Drop function if exists GET_LOADER_INFO//
Create function GET_LOADER_INFO (infoName varchar(50), batchNum int) returns varchar(255)

	return (select LOADER_INFO_VALUE 
			From LOADER_INFO t1 
			Where t1.LOADER_INFO_BATCH_NUM = batchNum 
				And LOADER_INFO_NAME = infoName collate utf8_general_ci
			Union All Select Null
			Limit 1);
//

Delimiter ;