dfs_serv_dq.xml with an associated
QKB path and locale. The configuration file contains each of the data
quality methods presented below. However, you can create custom wrappers
for definitions that are not presented in this topic. All of the data
quality methods have the same general syntax, except DQPARSE, DQEXTRACT,
and DQMATCH. DQPARSE and DQEXTRACT require an additional input token
that qualifies the output field. DQMATCH uses a sensitivity code that
specifies the degree of similarity for the data matching.
You can perform standardization
using the DQSTANDARDIZE method:
method dqstandardize(nnvarchar(256) value, nnvarchar(256) qkb_def,
nnvarchar(50) locale) returns nnvarchar(256);DQSTANDARDIZE method
supports the following data types for the value parameter:
nnvarchar(256)|date|timestamp
SELECT SYSPROC.DQ.DQUALITY.DQSTANDARDIZE (
STATE,
'State/Province (Full Name)',
'ENUSA' ) AS STANDARD_STATE
FROM employee
SELECT SYSPROC.DQ.DQUALITY.DQSTANDARDIZE (
postalCode,
'Postal Code',
'ENUSA' ) AS STANDARD_POSTAL_CODE
FROM employeeYou can perform matching
using the DQMATCH method:
method dqmatch(nvarchar(256) value, nvarchar(256) qkb_def, int sensitivity, nvarchar(50) locale) returns nvarchar(256);
DQMATCH method
supports the following data types for the value parameter:
nvarchar(256)|date|timestamp
SELECT SYSPROC.DQ.DQUALITY.DQMATCH (
postalCode,
'Postal Code', 85,
'ENUSA' ) AS MATCH_POSTAL_CODE
FROM employee
SELECT SYSPROC.DQ.DQUALITY.DQMATCH (
phone,
'Phone', 50,
'ENUSA' ) AS MATCH_PHONE
FROM employeeYou can perform pattern
analysis using the DQPATTERN method:
method dqpattern(nvarchar(256) value, nvarchar(256) qkb_def, nvarchar(50) locale) returns nvarchar(256);
SELECT SYSYPROC.DQ.DQUALITY.DQPATTERN (
name,
'Word',
'ENUSA' ) AS PATTERN_WORD
FROM employee
SELECT SYSPROC.DQ.DQUALITY.DQPATTERN (
address,
'City - State/Province - Postal Code',
'ENUSA' ) AS PATTERN_CITY_STATE_POSTAL
FROM employeeYou can perform identification
analysis using the DQIDENTIFY method:
method dqidentify(nvarchar(256) value, nvarchar(256) qkb_def, nvarchar(50) locale) returns nvarchar(256);
SELECT SYSPROC.DQ.DQUALITY.DQIDENTIFY (
Name,
'Field Name',
'ENUSA' ) AS IDENTIFY_FIELD_NAME
FROM employee
SELECT SYSPROC.DQ.DQUALITY.DQIDENTIFY (
email,
'E-mail (Country Identification)',
'ENUSA' ) AS IDENTIFY_EMAIL
FROM employeeYou can perform gender
analysis using the DQGENDER method:
method dqgender(nvarchar(256) value, nvarchar(256) qkb_def, nvarchar(50) locale) returns nvarchar(256);
SELECT SYSPROC.DQ.DQUALITY.DQGENDER (
NAME,
'Name',
'ENUSA' ) AS GENDER_NAME
FROM employee
The DQLOWERCASE method
applies lowercase text:
method dqlowercase(nvarchar(256) value, nvarchar(256) qkb_def, nvarchar(50) locale) returns nvarchar(256);
SELECT SYSPROC.DQ.DQUALITY.DQLOWERCASE (
name,
'Lower',
'ENUSA' ) AS LOWERCASE_PHONE
FROM employee
The DQUPPERCASE method
applies uppercase text:
method dquppercase(nvarchar(256) value, nvarchar(256) qkb_def, nvarchar(50) locale) returns nvarchar(256);
SELECT SYSPROC.DQ.DQUALITY.DQUPPERCASE (
name,
'Upper',
'ENUSA' ) AS UPPERCASE_PHONE
FROM employee
The DQPROPERCASE method
applies uppercase and lowercase text using context-sensitive rules:
method dqpropercase(nvarchar(256) value, nvarchar(256) qkb_def, nvarchar(50) locale) returns nvarchar(256);
You can perform parsing
using the DQPARSE method:
method dqparse(nvarchar(256) value, nvarchar(256) qkb_def, nvarchar(256) tokener, nvarchar(50) locale) returns nvarchar(256);
DQPARSE method
supports the following data types for the value parameter:
nvarchar(256)|date|timestamp
DQPARSE method. Here are samples of the
SELECT statement for parsing:
SELECT SYSPROC.DQ.DQUALITY.DQPARSE (
address,
'Address', 'Street Name',
'ENUSA' ) AS PARSE_ADDRESS_STREET_NAME
FROM employee
SELECT SYSPROC.DQ.DQUALITY.DQPARSE (
name,
'Name (Global)', 'Prefix',
'ENUSA' ) AS PARSE_NAME_PREFIX
FROM employeeYou can perform extraction
using the DQEXTRACT method:
method dqextract(nvarchar(256) value, nvarchar(256) qkb_def, nvarchar(256) tokener, nvarchar(50) locale) returns nvarchar(256);