View Table Schema

This documentation describes the View Table Schema (XMGETFMT) endpoint. This endpoint provides users with the list of available fields for any given table.

See the Authentication documentation for information on how to obtain the authentication headers within the request.

Use cases

  • Determine a table’s primary key field.
  • Determine the fields available within a table.

Supported attributes

AttributeTypeRequiredDescription
*setMethodstringYesDetermines the endpoint you are calling. Must be XMGETFMT to view table fields.
FORMATstringYesDetermines the table whose fields you wish to view.

Example request

curl --location "https://example.securemcloud.com/rest/rest.php?dataSource=methods&*view=xmsubmit" \
--header 'X-DICE-APPKEY: {{X-DICE-APPKEY}}' \
--header 'X-DICE-USERNAME: {{X-DICE-USERNAME}}' \
--header 'X-DICE-DATE: {{X-DICE-DATE}}' \
--header 'X-DICE-NONCE: {{X-DICE-NONCE}}' \
--header 'X-DICE-DIGEST: {{X-DICE-DIGEST}}' \
--header 'Accept: application/json' \
--form '*setMethod=XMGETFMT' \
--form FORMAT=DCCNTRYC

Example response

{
  "FORMAT": "DCCNTRYC",
  "NUMLOOPS": "3",
  "FIELD": [
    {
      "NUMBER": "1",
      "NAME": "COUNTRY",
      "LENGTH": "3",
      "PRECISION": "0",
      "NUMERIC_TYPE": "0",
      "TYPE_INPUT": "0",
      "PAD": "0",
      "DATE": "0",
      "YN": "0",
      "KEY_INDICATOR": "1"
    },
    {
      "NUMBER": "2",
      "NAME": "COUNTRY-CODE",
      "LENGTH": "3",
      "PRECISION": "0",
      "NUMERIC_TYPE": "0",
      "TYPE_INPUT": "0",
      "PAD": "0",
      "DATE": "0",
      "YN": "0",
      "KEY_INDICATOR": "0"
    },
    {
      "NUMBER": "3",
      "NAME": "DESCRIPTION",
      "LENGTH": "30",
      "PRECISION": "0",
      "NUMERIC_TYPE": "0",
      "TYPE_INPUT": "0",
      "PAD": "0",
      "DATE": "0",
      "YN": "0",
      "KEY_INDICATOR": "0"
    }
  ]
}

Response fields

FieldDefinition
NUMBERThe field’s assigned order in the display list.
NAMEThe identifier assigned to the field.
LENGTHThe maximum number of characters allowed to be input into the field.
PRECISIONIf applicable, determines how many places after a decimal point the field will track.
NUMERIC_TYPEIf applicable, specifies the storage method and types of numbers the field accepts. The available types are defined below.
TYPE_INPUTIf applicable, specifies if the field is required and if its length is fixed or variable. The available types are defined below.
PADDetermines the alignment/padding applied to the field. The available types are defined below.
DATEIf applicable, determines the date format of the field. The available types are defined below.
YNDetermines if the field is categorized as a Yes/No field (a field that accepts values for Yes, No, and blank states).
1: the field is a Yes/No field.
0: the field is not a Yes/No field.
KEY_INDICATORDefines the primary key of the table. This is used when paging through large requests using the *range parameter. See the Introduction to MADE Query API documentation for instructions on how to run a query using *range.
1: the field is the table’s primary key.
0: the field is not the table’s primary key.
DESCRIPTIONA brief explanation of the field.

Numeric types

The assigned NUMERIC type specifies the storage method and the types of numbers accepted as valid input.

TypeDefinition
0Fixed point positive and negative numbers.
1Fixed point positive numbers.
2Fixed point negative numbers.
3Binary storage of positive and negative numbers. Decimal implied. The decimal value is not stored but calculated for input and output based on the precision defined in the PRECISION field.
4Binary storage of positive numbers. Decimal implied. The decimal value is not stored but calculated for input and output based on the precision defined in the PRECISION field.
5Binary storage of negative numbers. Decimal implied. The decimal value is not stored but calculated for input and output based on the precision defined in the PRECISION field.
6PACKED storage of positive and negative numbers. Decimal implied. The decimal value is not stored but calculated for input and output based on the precision defined in the PRECISION field.
7Informix compatible storage.
8IEEE single precision compatible storage.
9IEEE double precision compatible storage.
ABinary Coded Decimal signed compatible storage. Decimal implied. The decimal value is not stored but calculated for input and output based on the precision defined in the PRECISION field.
BBinary Coded Decimal unsigned compatible storage. Decimal implied. The decimal value is not stored but calculated for input and output based on the precision defined in the PRECISION field.
CBinary Coded Decimal no sign compatible storage. Decimal implied. The decimal value is not stored but calculated for input and output based on the precision defined in the PRECISION field.
DASCII sign masked storage. Decimal implied. The decimal value is not stored but calculated for input and output based on the precision defined in the PRECISION field.
EASCII leading byte sign storage. Decimal implied. The decimal value is not stored but calculated for input and output based on the precision defined in the PRECISION field.
FASCII trailing byte sign storage. Decimal implied. The decimal value is not stored but calculated for input and output based on the precision defined in the PRECISION field.

Decimal Implied Example
For storage: number = number * 10 ^ precision (12.34 = 1234)
For display: number = number / 10 ^ precision (1234 = 12.34)

Type input options

The assigned TYPE_INPUT specifies if the field is required and if its length is fixed or variable.

TypeDefinition
0Optional and variable length.
1Optional and fixed length.
2Mandatory and variable length.
3Mandatory and fixed length.

Date types

The assigned DATE type specifies the format for date storage.

TypeDefinition
0Not a date.
1Date is expected as: MMDDYY
2Date is expected as: YYMMDD
3Date is expected as: DDMMYY
4Date is expected as: YYDDD
5SQL.
6Date is expected as: MMDDCCYY.
7Date is expected as: MMDDYY.
8String.

Pad types

The assigned PAD type specifies the padding to be used in fields that allow variable-length input.

TypeDefinition
0Pad with trailing spaces.
1Right justify data and pad with leading spaces.
2Pad with trailing zeros.
3Right justify and pad with leading zeros.
4Phone number.
5Social security number.
6Text field.