OnBeforeUpload function

Top  Previous  Next

This function has the following syntax:

 

function OnBeforeUpload(Input: Variant; var UseFileContents, IsKeyField, SkipField: Boolean): Variant;

begin

end;

 

Parameter name

Description

Input

If the source data type is files, this is the file name.  For CSV and Excel files, this is the data column in the source file.

 

UseFileContents

Set this value to True if the value is a file and you want SQL File Import to upload the contents of the file.

 

Default value is False.

 

IsKeyField

Set this value to True if the linked target column is to be used as a key field in an update or delete operation.

 

Default value is False.

 

SkipField

Set this value to True if you want SQL File Import to skip this field during the import.

 

Default value is False.

 

 

The result of the OnBeforeUpload function is the value that SQL File Import will use to process the target column.  If you do not want to change the input value in any way, simply assign the input value to the result e.g.

 

function OnBeforeUpload(Input: Variant; var UseFileContents, IsKeyField, SkipField: Boolean): Variant;

begin

 Result := Input;

end;

 

If the value is a file name, and you want SQL File Import to upload the contents of that file, set the UseFileContents value to True e.g.

 

function OnBeforeUpload(Input: Variant; var UseFileContents, IsKeyField, SkipField: Boolean): Variant;

begin

 Result := Input;

 UseFileContents := True;

end;