9.220 UNLOAD_FILE_DATA

Note: Built-In Function Rules     Usage Options

Will call the OAM for the requested file and unload all its data to the flat file specified. If the flat file specified already exists it will be overwritten.

This Built-In Function expects to be executed on the same machine as the OAM. Both the BIF and the OAM need to access the output file. If you execute the BIF from a local Function but redirect the File to SuperServer, it is your responsibility to ensure that the output filename is valid on both the client and the server.

Arguments

No.

Type

Req/Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

A

Req

The LANSA File Name

1

10

 

 

2

A

Opt

Output File Path/Name

Default Value = ....\X_ppp\source\<File Name>.dat

1

256

 

 

3

A

Opt

Y\N Check for OAM

Default = N

1

1

 

 

4

A

Opt

Unload BLOB and CLOB fields.
Default = N, meaning BLOB and CLOB are unloaded as their default (*SQLNULL).
If Y, if BLOB or CLOB fields exist on the file and are not Null, they are unloaded to files in the same directory as the output file (Arg 2), with the naming convention FileName_Field_DiskFile.ext (where DiskFile.ext is the disk file name saved in the table for the LOB).

1

1

 

 

5

A

Opt

Perform a Commit to release any database locks that the database may leave as part of this operation.

Default = N, for backward compatibility.
Y will release any database table locks.

Sybase leaves a database table locked at the end of this operation. This blocks dropping the table.

Set this value to Y to release the database table lock so that the table can be dropped, for example, by REBUILD_FILE.

1

1

 

 

6

A

Opt

CTD Location Level
A= All (Partition + System).
P = Partition Level only.
S=System Level only.

Default is A.

1

1

 

 

 

Return Values

No.

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

A

Req

Return Code:
OK = File successfully unloaded
ER = File unload failed (possible causes - invalid path, out of space on disk drive).
NT = No table exists
NO = No OAM. File does not exist or is not compiled.

NO only returned when input option 3 is set to Y.

2

2

 

 

2

L

Opt

Working list of files created for unloaded BLOB and CLOB files

256

256