SQL_GET_LOB¶
Applies to: ORAFlex SQLFlex MYSQLFlex PGFlex DB2Flex
This command is used for getting the value of a specified LOB field. Two optional parameters can be passed specifying the offset and length of the chunk to get. Passing these parameters essentially makes this call the same as SQL_GET_LOB_CHUNK. Depending on the situation, the two calls can be interchanged for improved code readability. Excluding these additional parameters will get the whole field value within DataFlex variable size limits.
Syntax
SQL_GET_LOB {FileName.FieldName} TO {variable} [ OFFSET {offset} LENGTH {length} ]
Parameter |
Description |
---|---|
FileName |
The name of the file that contains the specified LOB field |
FieldName |
The name of the LOB field |
variable |
The variable to hold the LOB value |
offset |
Integer amount to offset when getting the LOB value (optional) |
length |
Length of value to get from the LOB field (optional) |
Example
Set_Argument_Size 262144
String sResult
Move 262144 to iChunkSize
Move 0 to iChunk
Clear Customer
Move iID to Customer.ID
Find Eq Customer by Index.1
If (Found) Begin
Direct_Output ('Binary:' + sDestFileName)
SQL_GET_LOB_LENGTH Customer.Comments to iLength
While (iChunk*iChunkSize < iLength)
SQL_GET_LOB Customer.Comments to sResult OFFSET (iChunk*iChunkSize) LENGTH iChunkSize
Write sResult
Increment iChunk
Loop
Close_Output
End
SQL_LOB_TRUNCATE