Function: nornix_site.get_document_no

Information
DTD identifierDeterministicData accessMode
int(11)NOREADS SQL DATA

Code

Get document number and preload information

CREATE DEFINER=`root`@`localhost` FUNCTION `get_document_no`(vPath VARCHAR(127)) RETURNS int(11)
    READS SQL DATA
    COMMENT 'Get document number and preload information'
BEGIN
 DECLARE number INTEGER;
 IF NOT IFNULL(@tempdocpath = vPath, 0)
  THEN CALL get_document_sub(vPath);
 END IF;
 SELECT `No` INTO number
 FROM nornix_site.tempdoc
 ORDER BY `Level` DESC
 LIMIT 1;
 RETURN number;
END