SQL_GET_LOB_LENGTH¶
Applies to: ORAFlex SQLFlex MYSQLFlex PGFlex DB2Flex
This command is used to get the length of a specified LOB field. It is useful, for example, in determining the number of iterations to perform while reading from a LOB field using chunking.
Syntax
SQL_GET_LOB_LENGTH {FileName.FieldName} to {variable}
Parameter |
Description |
---|---|
FileName |
The name of the file containing the LOB field |
FieldName |
The name of the specified LOB field |
variable |
The variable to hold the length of the field |
Example
Set_Argument_Size 262144
String sResult
Move 16384 to iChunkSize
Move 0 to iChunk
Clear Customer
Move iID to Customer.ID
Find Eq Customer by Index.1
If (Found) Begin
SQL_GET_LOB_LENGTH Customer.Comments to iLength
While (iChunk*iChunkSize < iLength)
SQL_GET_LOB Customer.Comments to sResult OFFSET (iChunk*iChunkSize) LENGTH iChunkSize
// Do something with the LOB data
Increment iChunk
Loop
End
SQL_LOB_TRUNCATE