f2s_lob_get

Applies to: Oracle, MS SQL, MySql/MariaDB, PostgreSQL Drivers

Syntax

f2s_lob_get {FileName.FieldName} TO {variable}
f2s_lob_get {FileNumber} {FieldNumber} TO {variable}

Parameter

Description

FileName

The name of the file containing the LOB field

FieldName

The FieldName of the specified LOB field

FileNumber

Number of an open file (FileName.File_Number); available in 18.1

FieldNumber

Numeric DataFlex field number within that file; available in 18.1

variable

uChar[] array to hold the LOB value

Description

Added in Flex2SQL 18.1: The separate FileNumber and FieldNumber form accepts numeric literals, variables, or expressions that supply the file and field numbers. Both numbers are required and are separated by a space. This allows the target field to be selected at runtime. Use the updated 18.1 f2s.pkg and driver for this syntax. The existing FileName.FieldName form remains supported and is the form to use with earlier releases.

The file must already be open. FieldNumber is the DataFlex field number within that file, not a column-name string. You can resolve a field name to its number with Field_Map.

In the separate-number form, TO follows both numbers.

This command is used for getting the value of a specified LOB field.

Example

     UChar[] uResult
     Integer iID

     Move 1 to iID

     Open PicturesTest
     Clear PicturesTest
     Move iID to PicturesTest.id
     Find Eq PicturesTest by Index.1
     If (Found) Begin
         f2s_lob_get PicturesTest.PictureData to uResult
     End

Separate File and Field Numbers (18.1)

This example resolves PictureData at runtime and passes the two numbers separately:

UChar[] uResult
Integer iFile iField

Open PicturesTest
Move PicturesTest.File_Number to iFile
Field_Map iFile "PictureData" to iField

Clear PicturesTest
Move 1 to PicturesTest.id
Find Eq PicturesTest by Index.1
If (Found) Begin
    f2s_lob_get iFile iField to uResult
End

Replaces