Function: nornix_system.get_description

Information
DTD identifierDeterministicData accessMode
varchar(255) CHARSET utf8NOREADS SQL DATA

Code

Get description from number, select the best language

CREATE DEFINER=`root`@`localhost` FUNCTION `get_description`(vNo INTEGER) RETURNS varchar(255)
CHARSET utf8
    READS SQL DATA
    COMMENT 'Get description from number, select the best language'
BEGIN
 DECLARE d VARCHAR(255) DEFAULT '';
 SELECT `Text` INTO d
 FROM description
 WHERE `No` = vNo
 ORDER BY IF(FIND_IN_SET(LangCode, @nornixlang), FIND_IN_SET(LangCode, @nornixlang), 10000)
 LIMIT 1;
 RETURN d;
END