COLUMNS

Contents


Columns is used to limit the number of columns (or fields) loaded in or from class [F] during read or write instructions in the database.

Syntax

 

SYNTAXE 1  
Columns
class [ ( field[, field])

SYNTAXE 2  
Columns
class  With Mask( mask [, mask]) ]

Parameters

Element

Description

Restrictions

class

Abbreviation of an open file

the file must be already open.

Field

name of a field from the table.

None.

mask

Abbreviation of an open mask

the mask must be already open.

Examples

   # Read then rewrite limited to 2 fields, code anf file name
   Local File BPARTNER [BPR]
   # Position of the filter on the code and client name
   Columns [BPR](BPRNUM,BPRNAM)
   For [BPR]
       ...
       Rewrite [BPR]
   Next
   # filter deletion: all the columns are now available again
   Columns [BPR]

  # Column filter on the class derived from the link
  Local File ORDERS [ORD]
  Local File ITMMASTER [ITM]
  Link [ORD] with [ITM]ITM0=[F:ORD]ITMREF as [ORI]
  # Position of the filter on the product ref., the product dest., the order no.
  Columns [ORI]([ITM]ITMREF,[ITM]ITMDES1,[ORD]WIPNUM)
  For [ORI]
       ...
  Next
  # filter deletion: all the columns are now available again
Columns [ORI]

  # Column filter on the class derived from the link
  Local File ORDERS [ORD]
  Local File ITMMASTER [ITM]
  Link [ORD] with [ITM]ITM0=[F:ORD]ITMREF as [ORI]
  # Position of the filter on the product ref., the product dest., the order no. and all the fields of table [ORD]
  Columns [ORI]([ITM]ITMREF,[ITM]ITMDES1,[ORD])
  For [ORI]
       ...
  Next
  # filter deletion: all the columns are now available again
Columns [ORI]

Description and comments

Columns is used to limit the access to the columns of a previously open table, during read and write instructions in the database. This accelerates access to the data of this table.

Columns is applied as follows:

The Columns instruction is only taken into account by the For and Rewrite instructions. The Read and Write instructions still manage class[F] as a whole.

Class[F] still exists for the variables excluded by the Columns instructions, but they are no longer loaded by the For instruction.

If a Columns instruction comes after another Columns instruction, it cancels and replaces the previous one. The Columns [abv] instruction will therefore be used without any other argument in order to cancel any possible filter on a column.

To identify a column, it is possible to use an evaluate command. For instance:    
Columns [LNK]([ATB]ZERO,=evaluate("[ATB]INTITFIC"))

For a sized field, here are the various possibilities to identify columns:
Workstation selection: Columns [LNK]([ATB]TOTO(5))
Selection of the complete grid: Columns[LNK]([ATB]TOTO)
Selection of a range of workstations: Columns[LNK]([ATB]TOTO(1..8))

Syntax 2 makes it possible to specify one or two masks. In that case, the following principle is as follows: a column is selected for a table when a field with the same name is present in one of the declared masks.

Remarks

There is a locality level linked to those files open by Local File. On the other hand, there is no such level linked to the Columns order. Thus, if this order appears in a sub-program in a previously open table (and obviously not reopened in the sub-progam), said order will still be active when returning to the calling process.

The Columns instruction can be put after the link instruction in order to limit oneself to the useful fields and achieve increased performance.    

 

New to version 140

Syntax 2.

 

Associated errors

Error

Description

ERCLAS (7)

Abbreviation not found

Associated keywords

LINK  -  FOR  -  REWRITE


CONTENTS

Copyright © Sage 1999 - 2007