Scalable Database Server, HiRDB Version 8 Description
If a retrieved BLOB or BINARY data item is received by a client UAP as a BLOB-type or BINARY-type embedded variable, a memory area sufficient to store the received data must be allocated on the client side. This may strain the memory resources on the client side when large amounts of data are being retrieved. A large amount of data must also be transferred from the server to the client. However, if only a portion of the data is needed, or if the received data will be specified without change in another SQL statement and then returned to the server, transferring the data to the client is a waste of resources.
The locator facility is designed to overcome this problem. A locator is a four-byte value that identifies data on the server. By specifying a locator embedded variable in a single-row SELECT statement or in the INTO clause of the FETCH statement, you can retrieve in the search results only the locator value that identifies the data rather than the entire data item. You can also specify the locator embedded variable that identifies such data in another SQL statement, which enables you to process the data identified by the locator.
Figure 6-20 provides an overview of the locator facility.
Figure 6-20 Overview of the locator facility
The locator facility is useful whenever you retrieve BLOB or BINARY data.
By using the locator facility, the client need only allocate enough memory to store the size of the actual data being used. The amount of data transferred between the server and the client is also reduced because a locator is used.
Using the locator facility reduces the amount of memory required on the client side. It also reduces the amount of data transferred between the server and the client.
To receive the value of a locator, replace in the SQL statement the embedded variable that receives the BLOB-type or BINARY-type data with the applicable locator-type embedded variable. To process the data allocated in the locator, specify the applicable locator-type embedded variable in the SQL statement, rather than specifying a BLOB-type or BINARY-type embedded variable.
For details about the locator facility, see the HiRDB Version 8 UAP Development Guide.
All Rights Reserved. Copyright (C) 2007, Hitachi, Ltd.