Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

@Variables

Declares variables inside a named scope: global (visible throughout the file) or the name of a Procedure/Function declared in @Source (visible only inside that procedure/function, in addition to global ones).

@Variables {
    global {
        Username    char(10)
        MyDate      date
        Balance     number(9,2)
    }
    MyProcedure {
        counter    number(3)
    }
    Greet {
        name      char(10)
    }
}

One Name type(...) line per variable — same format as @Fields, but with more available types (see Data types): char, varchar, number, date, field(Field), list(type), matrix(rows, cols, type), struct(TemplateName).

Struct: inline template definition

Inside the global scope (only there) you can also define a struct template with struct Name [ ... ], before or after instantiating it with struct(Name) — see Data types: Struct for the full syntax and its limits.

Modifier

Only Description("text") is available in @Variables (unlike @Fields, it doesn’t support Default/AllowNull):

@Variables {
    global {
        RequestNo  field(ADHOJA50)  Description("Request number")
    }
}

Length/precision limits (standalone variable, different from a table field)

TypeLimit in @FieldsLimit in @Variables
char1–32,7661–16,773,104
varcharnot valid in @Fields1–16,773,100
number (precision)1–301–63

These larger limits in @Variables reflect that a variable declared there isn’t tied to a DDS physical file the way an @Fields field is.