The setdbprefs
function is not recommended. Use the following
replacement functionality to specify the data return format, error handling, and
missing data. Some differences between the workflows might require updates to your
code.
Data return format — For the 'DataReturnFormat'
database preference, these values are not recommended:
'numeric'
'cellarray'
'structure'
Error handling — The 'ErrorHandling'
database
preference is not recommended.
Missing data — The 'NullNumberWrite'
,
'NullStringWrite'
, and
'NullNumberRead'
database preferences for handling
NULL
data values are not recommended.
There are no plans to remove the setdbprefs
function at this
time.
Update CodeTo set the data return format in prior releases, you specified returning
imported data as a numeric matrix by setting the
'DataReturnFormat'
database preference to the value
'numeric'
. For example:
Now you can set the same value by using the 'DataReturnFormat'
name-value pair argument of the fetch
function.
Or, you can customize import
options.
To specify error handling in prior releases, you set the
'ErrorHandling'
database preference to the value
'report'
or 'store'
by using the
setdbprefs
function. For example:
Now you specify error handling by using the 'ErrorHandling'
name-value pair argument of the database
function or the
'ErrorHandling'
name-value pair argument of the executeSQLScript
function.
To specify the handling of missing data in prior releases, you set the
'NullNumberWrite'
database preference to a specific
value, for example. This table shows database preference settings that are not
recommended and the functionality you can use instead.
Discouraged Functionality | Recommended Replacement |
---|
setdbprefs('NullNumberWrite','NaN' ) | data input argument of sqlwrite
|
setdbprefs('NullStringWrite','null' ) | data input argument of sqlwrite
|
setdbprefs('NullNumberRead','0' ) | SQLImportOptions object |