ALLBASE/SQL Reference Manual (36216-90216)

Chapter 7 225
Data Types
Long Operations
UPDATE PurchDB.PartsIllus
SET PartPicture = '<newhammer.tools >newhammer'
WHERE PartName = 'hammer'
Using UPDATE to Change Stored Data Only
Here the stored data in LONG column PartPicture is replaced with data from the file
../tools/newhammer. Assuming the original output device was named hammer, when you
select or fetch the PartPicture column, the updated output still goes to a file named
hammer.
UPDATE PurchDB.PartsIllus
SET PartPicture = '<newhammer.tools'
WHERE PartName = 'hammer'
Using UPDATE to Change the Output Device Name and Options
You may want to change the output file name but not the LONG data associated with a
particular column. Here newhammer becomes the output device name. When LONG column
PartPicture is SELECTed or FETCHed, output is appended to the file newhammer.
UPDATE PurchDB.PartsIllus
SET PartPicture = '>>newhammer'
WHERE PartName = 'hammer'
Using UPDATE with Heap Space Input and Output
You may decide to use heap space as your input input device. Output may be directed to a
heap address. In this example, LONG data flows from file newsaw to the PartsIllus table,
and when this data is selected or fetched it goes to a heap address:
UPDATE PurchDB.PartsIllus
SET PartPicture = '< newsaw >%$'
WHERE PartName = 'saw'
In the next example, 4000 bytes of data flow to the database from heap address 1000 and
when the LONG column is selected or fetched, data goes to the file newsaw:
UPDATE PurchDB.PartsIllus
SET PartPicture = '<%1000:4000 >newsaw'
WHERE PartName = 'saw'
Using DELETE with LONG Column Data
DELETE and DELETE WHERE CURRENT syntax is unchanged when used with LONG columns.
It is limited in that a LONG column cannot be used in the WHERE clause.
In the following example, any rows in PurchDB.PartsIllus with the PartName of hammer
are deleted:
DELETE FROM PurchDB.PartsIllus
WHERE PartName = 'hammer'
When LONG data is deleted, the space it occupied in the DBEnvironment is released when
your transaction ends. But the data files still exist on the operating system.