f2s_lob_set_null¶
Applies to: Oracle, MS SQL, MySql/MariaDB, PostgreSQL Drivers
Syntax¶
f2s_lob_set_null {FileName.FieldName}
f2s_lob_set_null {FileNumber} {FieldNumber}
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 |
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.
Neither form of f2s_lob_set_null takes TO or a value argument.
This command is used to set a LOB column to null.
Example¶
UChar[] uResult Integer iID iLength iSize Move 1 to iID Open PicturesTest Clear PicturesTest Move iID to PicturesTest.id Find Eq PicturesTest by Index.1 If (Found) Begin Reread PicturesTest f2s_lob_set_null PicturesTest.PictureData SaveRecord PicturesTest Unlock End
Separate File and Field Numbers (18.1)¶
This example resolves PictureData at runtime and passes the two numbers
separately:
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
Reread PicturesTest
f2s_lob_set_null iFile iField
SaveRecord PicturesTest
Unlock
End