Database Toolbox    
setdbprefs

Sets preferences for database actions for handling NULL values

Syntax

Description

setdbprefs returns the current values for database action preferences.

setdbprefs('property') returns the current preference value for the specified property.

setdbprefs('property', 'value') sets the preference to value for the specified property.

setdbprefs({'property1'; ... ;'propertyn'}, {'value1'; ... ;
'
valuen'})
sets the preference values to value1 through valuen for the properties property1 through propertyn.

Allowable properties are listed in the following table.

Allowable Properties
Description
'NullNumberRead'
How NULL numbers in a database are represented when imported into MATLAB
'NullNumberWrite'
Numbers in MATLAB that are represented as NULL when exported to a database
'NullStringRead'
How NULL strings in a database are represented when imported into MATLAB
'NullStringWrite'
Strings in MATLAB that are represented as NULL when exported to a database

Examples

Example 1 - setdbprefs

Type setdbprefs and MATLAB returns

which means:

Example 2 - setdbprefs(property)

Type setdbprefs ('NullNumberRead') and MATLAB returns

which means any NULL number in the database is read into MATLAB as 0.

Example 3 - setdbprefs(property, value)

Type setdbprefs ('NullStringWrite','NaN')

which means that any 'NaN' string in MATLAB is exported to the database as a NULL string.

Example 4 - setdbprefs({'property1'; ... ;'propertyn'}, ... {'value1';'valuen'})

Type

which means:


 set sql2native