Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

9.38 DEFINE_OVERRIDE_FILE

Note
titleNote: Built-In Function Rules     Usage Options

...

The DEFINE_OVERRIDE_FILE's functionality is not available to the SELECT_SQL Free Format command.

Arguments

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

A

O

File Library name

If no File Library name is given, the BIF will remove all defined overrides.

1

10



2

A

O

File name

1

10



3

A

O

Override Database Table Owner name

If no override database table owner and table name is given, the BIF will try to remove any previously defined override.

1

128



4

A

O

Override Database Table name

If no override database table owner and table name is given, the BIF will try to remove any previously defined override.

1

128



Return Values

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

A

R

Return Code:

OK

2

2



Why are File Overrides required?

When installing an application only one OAM will be installed which has embedded in it the LANSA Library of when the OAM was generated.  If an application file is installed into a library which is different to the library embedded in the OAM, the OAM must be redirected to the appropriate LANSA Library at runtime.  The LANSA Library is mapped into the database equivalent, which has a different name in different database managers: it is variously called Schema, Owner and Collection.

...

An application has files installed into the Partition File Library. Typically the Partition File Library is NOT the same name as the BUILT library. If it were the same, then OVERRIDE of BUILT would also override the Partition File Library files. This would not achieve the desired outcome, as the files should always access the same library.

Use of Define_Override_File with SuperServer and LANSA Open.Net

The DEFINE_OVERRIDE_FILE operates on the database local to the RDML that is executing. When database IO is performed, the OAM checks the file overrides on the machine/process where the OAM is executing. Therefore, an OAM executing on a server requires that the file overrides have been set up on the server by using CALL_SERVER_FUNCTION and calling the DEFINE_OVERRIDE_FILE appropriately. This is true for both SuperServer and LANSA Open .Net.

How to set up an override

1.      A valid File Library name and optionally a File Name must be provided to indicate the file(s) that overrides should be applied to.

2.      A valid Override Database Table Owner name and/or Override Database Table name must also be provided. The below table illustrates all valid cases:

Description

File Library Name

File Name

Override Database Table Owner Name

Override Database Table Name

Override all Files under a specific File Library name to a different Database Table Owner

X

*Default

X


Override a specific File to a different Database Table Owner.

X

X

X


Override a specific File to a different Database Table with the same Database Table Owner.

X

X

*Default

X

Override a specific File to a different Database Table.

X

X

X

X

How to remove an override of group of overrides

1.      Execute DEFINE_OVERRIDE_FILE with no arguments values supplied to remove all overrides on database files.

...

3.      Execute DEFINE_OVERRIDE_FILE with the File Library Name and File Name arguments to remove overrides from a specific file.

Description

File Library Name

File Name

Override Database Table Owner Name

Override Database Table Name

Remove all defined overrides





Remove a File Library override

X




Remove a specific File override

X

X



Examples

Example 1: Override all Files under a specific File Library name to a different Database Table Owner ABC

     Use BIF(Define_Override_File) ('DC@DEMOLIB' *Default 'ABC') To_Get(#retcode)

Example 2: Override a specific File to a different Database Table Owner ABC

     Use BIF(Define_Override_File)  ('DC@DEMOLIB' 'PSLMST' 'ABC') To_Get(#retcode)

Example 3: Override a specific File to a different Database Table with the same Database Table Owner

     Use BIF(Define_Override_File) ('DC@DEMOLIB' 'PSLMST' *Default 'XYZ') To_Get(#retcode)

Example 4: Override a specific File to a different Database Table

     Use BIF(Define_Override_File) ('DC@DEMOLIB' 'PSLMST' 'ABC' 'XYZ') To_Get(#retcode)

Example 5: Remove all defined overrides

     Use BIF(Define_Override_File) To_Get(#retcode)

Example 6: Remove a File Library override

     Use BIF(Define_Override_File)  ('DC@DEMOLIB') To_Get(#retcode)

Example 7: Remove a specific File override

     Use BIF(Define_Override_File) ('DC@DEMOLIB' 'PSLMST') To_Get(#retcode)