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
| Attribute | Type | Required | Description |
|---|---|---|---|
*setMethod | string | Yes | Determines the endpoint you are calling. Must be XMGETFMT to view table fields. |
FORMAT | string | Yes | Determines 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
| Field | Definition |
|---|---|
| NUMBER | The field’s assigned order in the display list. |
| NAME | The identifier assigned to the field. |
| LENGTH | The maximum number of characters allowed to be input into the field. |
| PRECISION | If applicable, determines how many places after a decimal point the field will track. |
| NUMERIC_TYPE | If applicable, specifies the storage method and types of numbers the field accepts. The available types are defined below. |
| TYPE_INPUT | If applicable, specifies if the field is required and if its length is fixed or variable. The available types are defined below. |
| PAD | Determines the alignment/padding applied to the field. The available types are defined below. |
| DATE | If applicable, determines the date format of the field. The available types are defined below. |
| YN | Determines 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_INDICATOR | Defines 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. |
| DESCRIPTION | A brief explanation of the field. |
Numeric types
The assigned NUMERIC type specifies the storage method and the types of numbers accepted as valid input.
| Type | Definition |
|---|---|
| 0 | Fixed point positive and negative numbers. |
| 1 | Fixed point positive numbers. |
| 2 | Fixed point negative numbers. |
| 3 | Binary 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. |
| 4 | Binary 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. |
| 5 | Binary 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. |
| 6 | PACKED 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. |
| 7 | Informix compatible storage. |
| 8 | IEEE single precision compatible storage. |
| 9 | IEEE double precision compatible storage. |
| A | Binary 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. |
| B | Binary 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. |
| C | Binary 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. |
| D | ASCII 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. |
| E | ASCII 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. |
| F | ASCII 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.
| Type | Definition |
|---|---|
| 0 | Optional and variable length. |
| 1 | Optional and fixed length. |
| 2 | Mandatory and variable length. |
| 3 | Mandatory and fixed length. |
Date types
The assigned DATE type specifies the format for date storage.
| Type | Definition |
|---|---|
| 0 | Not a date. |
| 1 | Date is expected as: MMDDYY |
| 2 | Date is expected as: YYMMDD |
| 3 | Date is expected as: DDMMYY |
| 4 | Date is expected as: YYDDD |
| 5 | SQL. |
| 6 | Date is expected as: MMDDCCYY. |
| 7 | Date is expected as: MMDDYY. |
| 8 | String. |
Pad types
The assigned PAD type specifies the padding to be used in fields that allow variable-length input.
| Type | Definition |
|---|---|
| 0 | Pad with trailing spaces. |
| 1 | Right justify data and pad with leading spaces. |
| 2 | Pad with trailing zeros. |
| 3 | Right justify and pad with leading zeros. |
| 4 | Phone number. |
| 5 | Social security number. |
| 6 | Text field. |