ALLBASE/SQL Reference Manual (36216-90216)

Chapter 8 257
Expressions
String Functions
2. SUBSTRING example
For every row in PartsIllus, the PartNumber and the first 350 bytes of the PartPicture
are inserted into the DataBank table:
CREATE TABLE DataBank
(IdNumber INTEGER,
Data VARBINARY(1000))
INSERT INTO DataBank
SELECT PartNumber, SUBSTRING(PartPicture,1,350)
FROM PartsIllus
Display a substring of the PartPicture column in the PartsIllus table if the Data column
in the DataBank table contains more than 133 bytes:
SELECT DATA
FROM DataBank
WHERE STRING_LENGTH(Data) > 133