company logo

TO FILE keyword

The keyword can be written in capital or small letters, but not mixed. Using capital letters refers to a reserved keyword. In order to refer to the file output function from within an operation path, the toFile keyword should be used, instead.

The TO FILE keyword requires a file specification as parameter:

to file ( Path=file_path | PathOption=option_name,

FileType=file_type, Headline=headline_opt,

Definition=type_def, Source=source_name )

file_path - Complete file path to be imported

option_name - Alternatively to the file path an option name may be defined. The option must be set to the file path. The option name is also used as extent name for the external file collection. In case of XML export, this becomes the name of the root element.

file_type - File storage format (xml, csv, oif, esdf) when this is different from the file name extension.

headline_opt - Headline option indicates for csv or esdf files that a headline has to be written (true).

type_def - Name of data type definition defining for the collection in database. Instead of a type definition a file name for a definition file (ODL, ESDF or XML format) may be defined.

source_name - Property definitions in type definitions for external data sources may contain any number of source definitions. Source definition to be used for export may be identified by source name. When no source name has been passed, the first source definition for each property is used. File type definitions contain only one source for each property, which is not named, i.e. source name must not be defined when providing an external (file) definition.

toFile( Path='c:/temp/my_persons.xml', FileType='xml',

        Source="export1", Definition='xml::Person', Headline = false)

Notes:

Calling the toFile operation in an OSI application several times, parameter values are used for initialization only when calling the operation the first time. Hence, changing parameters for next call will not have any effect.

Definition: 

_tofile               := __tofile   | tofile__

tofile__              :: 'toFile'

__tofile              := _to _file

_to                   := 'to'           | __to

__to                  :: 'TO'

_file                 := 'file'         | __file

__file                :: 'FILE'

Related topics