Read Tables - Serial and keyed

Code: K

This function kind invoke serial and keyed reads of the Tables.

Tables have pre-defined keys Which are used to locate and access the records.Refer to the Detailed Design Documentation for the key structure and Table Class numbers.

Data items with an address of 0006, will automatically invoke a key read, because Mera knows that this is a key, therefore if you code a K read on the first line of the function code it will override the automatic Key read.If you want to invoke a special key read in addition to the automatic key read, leave the first line of the function codes blank.

Keyed reads in application data, parameters and documentation (Single Key)

Parameter

Value

Parameter

Value

Description

0

2-17

Record area

1

0-99

Table number

Default

The table number from the owner of record.

If parameter 2 and 3 is the default table, group and class is seen from main record passed two process.

2

0-9

Group

Default

The remainder from table number divided by the 10th

3

0 or default

Application Data

1

Parameters

2

Documentation

4

0 or default

Find the header record, using the visual key only.(24 characters)

1

Find the extension-1 record, using the visual key and extension-1.(26 characters).

2

Find the extension-extension-1 and 2 records, using the visual key, extension-extension 1 and-2.(28 characters)

11

Give next extension-1 record

111

Give next extension-1 record.

Allow gaps in inquiry mode

12

Give next extension-2 Record

112

Give next extension-2 record.

Allow gaps in inquiry mode

5

0 or default

Record must exist

1

Record must not exist

2

Record may or may not exist

3

4

0-2

Record must exist.

Break if item is empty.

4

4

0-2

Record may or may not exist.

Break if item is empty.

5

4

1-2

Record may or may not exist.

Ignore if extension not available.

6

4

0

Give number from number stack Entered

7

4

0-2

Record may or may not exist.

Also performed in inquiry mode.

9

4

1-2

Give next available extension depending on parameter 4th

10-15

4

0-2

As 0-5 but try all tables within group (Add 10 to table)

K

4

3

Set value for sequential reads

6

Default

K in inquiry mode if condition fails dove two tangling.

Default

4

> 10

G

6-8

Passed two function G as parameter 1, 4 and 7 if condition in parameter 5 fails

9

0-99

Viewed

Default

Any seen.

On creation set is set to 0th

Keyed reads in application data, parameters and documentation Relations (Double key)

Parameter

Value

Parameter

Value

Description

0

2-17

Record area

1

0-99

Table number of the first part of a double-key

2

0-99

Table number of the second part of a double-key

3

3

Application Data

4

Parameters

5

Documentation

4

4

Find the record

6

Find the record using second party header only

7

Find the record (Part / warehouse)

5

0 or default

Record must exist

1

Record must not exist

2

Record may or may not exist

6

Default

K in inquiry mode if condition fails dove two tangling otherwise

Default

4

> 10

G

6-8

Passed two function G as parameter 1, 4 and 7 if condition in parameter 5 fails

9

0-99

Viewed

Default

Any seen.

On creation set is set to 0th

Sequential reads in application data, parameters and documentation (Single Key)

Parameter

Value

Parameter

Value

Description

0

2-17

Record area

1

0-99

Table number

2

0-9

Group

Default

The remainder from table number divided by the 10th

3

0 or default

Application Data

1

Parameters

2

Documentation

4

3

Set start.

10

Find the next header record.

13

Find the next record

14

Find the next record with a a value in extension-1

15

Find the next record with a a value in extension-2

110

Find the previous header record.

113

Find the previous record

114

Find the previous record with a a value in extension-1

115

Find the previous record with a a value in extension-2

5

Default

At end

3-28

Number of characters in key Which may not change during reads

K

The key must not differ from initial value during reads.

K

4

3

Set initial value for sequential reads

6

Default

K in inquiry mode if condition fails dove two tangling otherwise

Default

4

> 10

G

6-8

Passed two function G as parameter 1, 4 and 7 if condition in parameter 5 fails

9

0-99

Viewed

Default

Any seen.

Relational sequential reads of application data, parameters and documentation Relations (Double key)

Parameter

Value

Parameter

Value

Description

0

2-17

Record area

1

0-99

Table number of owner

2

0-99

Table number of related

3

0 or default

Application Data

1

Parameters

2

Documentation

4

3

Set start.

30

Find the next related header record.

31

Find the next relationship with a record a value in extension-1

32

Find the next relationship with a record a value in extension-2

33

Find the next related record

130

Find the previous relation header record.

131

Find the previous related record with a a value in extension-1

132

Find the previous related record with a a value in extension-2

133

Find the previous related record

5

26-30

Number of characters in key Which may not change during reads

6

Default

K in inquiry mode if condition fails dove two tangling otherwise

Default

4

> 10

G

6-8

Passed two function G as parameter 1, 4 and 7 if condition in parameter 5 fails

9

0-99

Table number of membership

Default

Any table within the context table

Sequential reads of alternate keys in application data, parameters and documentation (Double key)

Parameter

Value

Parameter

Value

Description

0

2-17

Record area

1

0-99

Table number of owner

2

0-99

Table number of alternative key

3

0 or default

Application Data

1

Parameters

2

Documentation

4

23

Set start.

20

Find the next header record.

21

Find the next record with a a value in extension-1

22

Find the next record with a a value in extension-2

24

Find the next record

130

Find the previous relation header record.

131

Find the previous related record with a a value in extension-1

132

Find the previous related record with a a value in extension-2

133

Find the previous related record

5

Default

At end

3-26

Number of characters in key Which may not change during reads

K

The key must not differ from initial value during reads.

K

4

23

Set initial value for sequential reads

6

Default

K in inquiry mode if condition fails dove two tangling otherwise

Default

4

> 10

G

6-8

Passed two function G as parameter 1, 4 and 7 if condition in parameter 5 fails

9

0-99

Viewed

Default

Any seen.

Parameter Description

0 The record area (defaulted by Mera)

1 The Table number

The following base tables are standard

Table Viewed Description Table Viewed Description

00 Customers 01 Parts

10 Suppliers 0 Stock

20 Work Centers 1 Cost 0 Production 11 Bill of Production

1 Interbal Issues 0 BOP for WC

2 Inventory counting 1 Master Routing

3 Stock transfers

30 Transfer

40 Production

50 General Ledger

0 Account

1 Text

60 Carrier

70 Employee

80

90 Assets

0 Fixed Asset

1 Project

2 The Group number

The following groups are standard:

Group Description

0 Accounts

1 Elements

2 Stock movements

3 Orders

4 Acknowledgements

5 Vouchers

6 Resouces

7

8 Documents

Note: If parameter 4 indicate that this is a relationship read), then this

ice cream the Table Group of the record defined in the secondary part of the key.

Default: If left blank the Table number will be used.

3 The Table Class number.

The folling Classes Are Available

Class Description

0 Kart Application Data

1 Para Parameters

2 Docu Documentation

3 Kartkey Application data relationships

4 Parakey Parameter relationships

5 Docukey Documentaion relationships

6 Bild Forms

7 - Terminal Information

8 -

9 Jobnet Job Information

B Virtual data derived from a process.

C Process variables and SQL comparisons

F Overall data names

4 The type of read.

This is divided into 2 main categories of read, keyed reads Which Have a value in this parameter <10

Serial reads Which Have a value in this parameter of> 9

The following types of read are available.

Keyed Reads

00 = Find the header record, using the visual key only.

(24 characters)

01 = Find the extension-1 record, using the visual key and extension-1.

(26 characters).

In table 001 only - use the warehouse you are logged into as the extension if the extension you are Delivering to the filehandle is zero.

02 = Find the extension-extension-1 and 2 records, using the visualize key, extension-extension 1 and-2.

(28 characters)

03 = Set a starting point for the following serial read.

This is used to start a list from the key value Entered by

the user.

04 = Read double key.

05 = Read alternative key

23 = Set a starting point for the following serial read of

alternative keys.

Serial Reads

10 = Find the next record, using the visual key only, extension-extension-1 and 2 will be blank, therefore the header records only will be read serially.

11 = Find the next extension-1 record of a main record.

If a page function is included on the form then automatic page control is invoked.

111 = If gabs is allowed in inquiry with filter

12 = Find the next extension-2 record of an extension-1 record.

112 = If gabs is allowed in inquiry with filter

13 = Find the next record regardless of it's extension.

14 = Find the next record with a value in extension-1.

15 = Find the next record with a value in extension-2.

20 = Find the next Alternative key header record.

(Using. Key table).

21 = Find the next Alternative key extension-1 record.

(Using. Key table).

22 = Find the next Alternative key extension-2 record.

(Using. Key table).

30 = Find the next relationship key header record.

(Using. Key table).

31 = Find the next relationship key extension-1 record.

(Using. Key table).

32 = Find the next relationship key extension-2 record.

(Using. Key table).

33 = Find the next relationship regardless of the key extension records

(Using. Key table).

? = Read in reverse order.

5 Error Condition Code.

This code determines the availability of the record.

If the availability requested in the parameter below, does not apply, then the error condition processing defined in the parameter 6 will be invoked.

Mera determines if a record is available to the user depending on all

The following factors:

  • The physical existence of the record.
  • The Record Access Level set on the user's password, refer to the User Manual for a description of the Record Access Level.
  • The filters that have been seen on the data item or set to run-time.

On keyed read the following conditions can be viewed:

0 or blank = The record must be available

1 = The record must not be available and if the key is blank the system will get the next number from the stack.

2 = The record may or may not be available and if the key is blank the system will get the next number from the stack.

3 = The record must be available.Break a

duplication if the data item on the form is blank.

This is used if multiple lines Can Be Entered on a Form and they are not all used (without this code an error condition would arise, due to a blank table item not existing as a key in the table).

4 = The record may or may not exist, but break if

the field is left blank.

5 = As for 2 - but ignore the field if it is blank.

6 = Give number from the stack Entered

7 = As 2 - but works in inquiry mode.

On Serial reads the following applies

1-60 = This specifies the number of characters in the

Which key may not change during read next

K = The key nust not change from start value.during

read next ..

6-8 Error processing codes .

This parameter defines the error processing to be invoked, if an error

exists.Refer to the Action codes in the Appendix for a list of valid

codes and their actions.

9 Set number.

This data item is responsible for controlling sets of data.It can be used when accessing only certain sets of tables.

Alternate or relationship records, the functionality of each is described below:

Alternate Keys

This parameter determines the set that the alternative materials key belong to.

Blank will cause all alternate keys for the table to be read.

A numeric value will cause only records with that number set to be read.

If a table has several alternate keys, each alternate-key type would have a set number, Which is the number used here.

Relationship keys

This parameter determines the set that the relationship key belongs to.

Blank will cause all relationships for the group to be read.

A numeric value will cause only records with that group number to be read.

Relationships are between two tables, with different table numbers, however the facility exists to group like tables together in order to access them as if they had the same table number.

Example:

READ Supplier Table:

Par1 = 10 (Supplier Table number)

PAR2 = 0 (Supplier Group number)

READ Relationships between Supplier and Purchase Order:

Par1 = 10 (Supplier Table number)

PAR2 = 3 (Purchase Order Group number)

PAR9 = 13 (Purchase Order Table number)

READ Alternate keys between Phone number and Supplier:

Par1 = 10 (Supplier Table number)

PAR2 = 0 (Supplier Group number)

PAR9 = 1 (Phone no. Set ID)

A few rules apply when using this function, they are:

When accessing Tables by their Alternate keys Mera presents the alternate or link key which was used to access the record in the Transaction Key area.

Keyed Reads, ie a C function with parameters <9th

When a read of this type is invoked, and the record does not physically exists, Mera will attempt to find the record using the supplied key as an alternate key.

When creating customized data items you must use addresses higher than 3000th

Any data items, embedded in the record and used as a key to access other records, it must have an address Which results in a whole number when the formula

Address 2 / 32 is applied.In addition the 2 characters preceding this address must not be used.

When painting screens with header and detail records, Mera will automatically detect that an extension 1 record has been read for the same table as a header record, and Mera will automatically look in the dictionary for a READ NEXT command, and use it.Therefore to use this technique all you have to do ia Ensure a READ NEXT command is set up for the table in the dictionary.

Example:

Establish Relationships between supplier and Purchase Order:

Par1 = 10 (Supplier Table number)

PAR2 = 3 (Purchase Order Group number)

PAR9 = 13 (Purchase Order Table number)

Establish Alternate keys between Phone number and Supplier:

Par1 = 10 (Supplier Table number)

PAR2 = 0 (Supplier Group number)

PAR9 = 1 (Phone no. Set ID)

Relationship Data Items, Which will be used to access their related records.

These can be anywhere in the record, providing the following rules are observed.

  • The relationship data item must have a physical key structure, (Ie 30 characters, representing-environment no.table no., visualize key, extension 1 and extension-2).
  • The visual key can be split into several data items, this is known as a split visualize key.
  • The address of the first data item in the visual key must result in a whole number when the following formula is applied:

Address - 2

32

Because (The environment number and the table number are automatically inserted in the two posi t prior to the key).

When setting up relationship keys Ensure that this R function is preceded by a C function To ensure that the record exists