0
 
// Convert to string & add leading zeros for a string
// with length aLen
CREATE FUNCTION LeadingZeros(aValue INTEGER,aLen INTEGER)
RETURNS VARCHAR(10)
BEGIN
  DECLARE L INTEGER;
  DECLARE sRESULT VARCHAR(20);
  SET sRESULT= '0000000000' || TOSTRINGLEN(aValue,aLen);
  SET L=CHAR_LENGTH(sResult);
  RETURN SUBSTRING(sResult FROM 1+L-aLen);
END;
Category: 
SQL Functions & Procedures
Current Version: 
1.00
Supported Products: 
NexusDB V2
NexusDB V3
Home