Alternate error return values  Defining ODL functions

Chapter 3: Building Production Objects

Error codes

When checking the value of the reason argument, use either the mnemonic (for example, EPARSE) or the integer value (for example, 5).

Table 3-18: Error codes

Error code

Value

Description

1 *

The production rule has generated too many bytes.

 2 *

The production rule has generated too few bytes.

3

Not used.

ETRANSPORT

4

Transport error—DFC.

EPARSE

5

Parse error; could not satisfy input field with data given.

EIDFAILED

6

Validation function on field failed.

EFILTER

7

Filter failed. A custom filter function returned a value of zero (0).

EBADFLD

8

Input field invalid; message too short.

EINVALDATA

9

Invalid data character where numeric.

EBADRULE

10

Rule object damaged or invalid. Part cannot find field reference.

ENOFLDDATA

11

Input field empty. Datalink with no data in it.

EBADFLDLEN

12

Input field overrun. Input message length too big (usually a default value problem).

ENOQUAL

13

Qualification object failed; only seen during a test drive. A transaction did not pass a production rule’s qualification function criteria

ENOTABLE

14

A table file required by the production object cannot be found.

EBADTYPE

15

Datatype mismatch—the data in the incoming transaction does not agree with the input field’s datatype.

ENOTHIT

16

Data in the incoming transaction does not match any tag in the specified table object.

ECHAIN

17

Recursive input field chaining detected. For example, fld_b follows fld_a, fld_c follows fld_b, and fld_a follows fld_c.

18

Not used.

ENOTBLMEM

19

Out of memory. The table object is too big to load into memory.

ETBLDUPES

20

Cannot load table object due to duplicate entries.

EMEMORY

21

Out of memory.

* When error 1 or 2 occur, if your error function returns a value of 1, the SFM truncates or extends the blob, as necessary, and attempts to continue.

StepsWriting error functions

  1. To create a production object error function:

    1. Select Pro-Obj in the main TRAN-IDE window.

    2. To create an error function in a new production object, click New below the Production Objects list. To create or edit an error function for an existing production object, double-click the object in the Production Object list.

    3. In the Production Object Information window, enter a name in the Error Func field and click the ellipsis button. To edit an existing error function, select the function from the Error Func drop-down list, and click the ellipsis. The Error Function window appears.

  2. To create a rule object error function:

    1. Select Pro-Obj in the main TRAN-IDE window, then click the Rules icon. The Output Rules list displays in the left pane.

    2. To create an error function in a new rule, click New below the Output Rules list. To create or edit an error function for an existing rule object, double-click the rule in the Output Rules list.

    3. In the Current Output Rule window, enter a name in the Error Func field and click the ellipsis button. To edit an existing error function, select the function from the Error Func drop-down list, and click the ellipsis. The Error Function window appears.

  3. Write the error function in the text editor pane. Click Load to load a text file into the function. Click Append to load a text file to append on to the error function.

    Error function arguments included:

  4. Complete these options in the Error Function window:

    Field (key)

    Description

    Public

    Sets the error function status to public, which means that different modules can use this error function. The default is static (unselected), which means that only the production and rule objects in the current module can use the error function.

    Goto Line#

    Moves the cursor to the specified line of ODL text in the function text editor pane. Enter the line number to go to then press Enter. The ODL text editor moves the cursor to the specified line of text and highlights it.

    WARNING!  Click once on the text or use an arrow key to de-select it before typing anything new, otherwise the selected line is replaced with the new characters.

    DFC’s

    Select the DFC to add to this error function. Select an existing DFC from the drop-down list, or click the ellipsis button to create a new DFC. See the e-Biz Impact MSG-IDE Guide for more information.

    Datalink

    Datalinks allow you to share data with other functions and TRAN-IDE objects, which can also change the data in the datalink. Select an existing datalink from the drop-down list. Click the ellipsis button to create a new datalink. See “Building a datalink”.

    Module

    To place the error function into a different module, select the module from the drop-down list. If you place the error function into a different module, you must make the function public.

  5. When you finish, select from these options:





Copyright © 2005. Sybase Inc. All rights reserved. Defining ODL functions

View this book as PDF