MDS Driver Reference

About the MDS Driver

The MDS driver provides access to an in-memory database for SAS Federation Server.

Data Types

MDS supports the following data types. All types support NULL.
Data Type
Description
NUMERIC
precision scale
DECIMAL
precision scale
DATE
'yyyy/mm/dd'
TIME
'hh:mm:ss'
TIMESTAMP
'yyyy/mm/dd hh:mm:ss[.ssss]'
BINARY(len)
fixed length binary data
VARBINARY(maxlen)
variable length binary data
CHAR(len) [CHARACTER SET xxx]
fixed length character data
VARCHAR (maxlen) [CHARACTER SET xxx]
variable length character data
NCHAR(maxlen)
fixed length Unicode data
NVARCHAR(maxlen)
variable length Unicode data
BIGINT
64-bit signed integer
UBIGINT
64-bit unsigned integer
INTEGER
32-bit signed integer
UINTEGER
32-bit unsigned integer
DOUBLE
8-byte IEEE floating-point values (missing values are not supported)

Connection Options

MDS supports the following connection string options.
Option
Description
CATALOG
CATALOG=catalog name;
Specifies the catalog name.
NUMERICS
NUMERICS= Y | N
Allows numeric data types or treats them as double precision. The default is Y (Yes).
CT_PRESERVE
CT_PRESERVE = STRICT | SAFE | FORCE | FORCE_COL_SIZE
Allows users to control how data types are mapped. Note that data type mapping will be disabled when CT_PRESERVE is set to STRICT. If the requested type does not exist on the target database, an error is returned. The options are:
  • STRICT The requested type must exist in the target database. No type promotion will occur. If the type does not exist, an error is returned.
  • SAFE Target data types will be upscaled only if they will not result in a loss of precision or scale. When character encodings are changed, the new column size will be recalculated to ensure all characters can be stored in the new encoding.
  • FORCE This is the default for all drivers. The best corresponding target data type will be chosen, even if it could potentially result in a loss of precision or scale. When character encodings are changed, the new column size will be recalculated to ensure all characters can be stored in the new encoding.
  • FORCE_COL_SIZE This option is the same as FORCE, except that the column size for the new encoding will be the same as the original encoding. This can be used to avoid <i>column size creep</i> that has been seen in some cases, but it means that the resulting column might be too large or too small for the target data.
IDCASE
IDCASE=SENSITIVE | INSENSITIVE
Specifies if schema, table, column, and alias identifiers are case-sensitive or insensitive. The default is case sensitive.
DEFAULT_ATTR
DEFAULT_ATTR=(attr=value;...)
DEFAULT_ATTR is used to specify connection handle or statement handle attributes supported for initial connect-time configuration. Where attr=value corresponds to any of the options below:
  • CURSORS=n- Connection handle option. This option controls the driver’s use of client side result set cursors. The possible values are 0, 1 or 2.
    0 Causes the driver to use client side static cursor emulation if a scrollable cursor is requested but the database server cannot provide one.
    1 Causes the driver to always use client side static cursor emulation if a scrollable cursor is requested. The database server’s native cursor will never be used.
    2 (Default) Causes the driver to never use client side static cursor emulation if a scrollable cursor is requested. The database server’s native cursor will be used if available – otherwise the cursor will be forward only.
    Example: DEFAULT_ATTR=(CURSORS=2)
  • USE_EVP=n— Statement handle option. This option optimizes the driver for large result sets. The possible values are 0 (OFF) or 1 (ON), which is the default. Example: DEFAULT_ATTR=(USE_EVP=0)
  • XCODE_WARN=n - Statement handle option. Used to warn on character transcoding errors that occur during row input or output operations. Possible values are 0 (returns an error), 1 (returns a warning), or 2 (ignore transaction errors). Example: DEFAULT_ATTR=(XCODE_WARN=1)
DEFSCHEMA
DEFSCHEMA=schema name
Specifies the default schema for identifiers with no schema qualifier. The default is the first SCHEMA= in the connection string.
REFTYPE
REFTYPE=VARCHAR | NVARCHAR | VARBINARY
Indicates that duplicate column data should be stored once and referenced by result sets rather than having separate instances in each row. This reduces memory usage with large numbers of duplicate data but might slow down performance.
  • VARCHAR Create a REFCHAR instead of a VARCHAR when specified. The default is create VARCHAR.
  • NVARCHAR Create an NREFCHAR instead of an NVARCHAR when specified. The default is create NVARCHAR.
  • VARBINARY Create a REFBINARY instead of a VARBINARY when specified. The default is create VARBINARY.
Note: A REFCHAR(32) uses less space than a VARCHAR(32) if there are many duplicate values in the table or if the data is less than 32 characters. However, a REFCHAR(1) generally uses more memory than a VARCHAR(1) because an extra pointer has to be stored instead of a single character.
MAXDBMEM
MAXDBMEM=number of bytes
Specifies the maximum amount of memory the database can use to store all row data for all tables. The default is no limit.