Download presentation
Presentation is loading. Please wait.
Published byGwendolyn Bailey Modified over 8 years ago
1
Insensitive – Not a Bad Thing for Data Noreen Redden Information Builders
2
Why Case Insensitivity Two Worlds Why ? How? Problem?
3
TABLE FILE EMPSQL PRINT LN FN PAY WHERE LN EQ ' deFazio ' END SQL SELECT T1. " LN ",T1. " FN “,T1. " PAY " FROM master.dbo.EMPSQL T1 WHERE (T1. " LN " = ' deFazio ‘) ; Why Case Insensitivity Two Worlds: Selection DEFAZIO ANTHONY 10,000 deFazio Anthony 10,000 DeFazio Anthony 10,000 deFazio Anthony 10,000
4
TABLE FILE EMPSQL PRINT LN FN PAY WHERE UPCASE(15,LN, ' A15 ‘) EQ ‘ DEFAZIO ' END SQL SELECT T1. " LN ",T1. " FN ",T1.CDEPT,T1. " CDIV ",T1.PAY FROM master.dbo.EMPSQL T1 Why Case Insensitivity Two Worlds: Selection – NOT Optimized DEFAZIO ANTHONY 10,000 deFazio Anthony 10,000 DeFazio Anthony 10,000
5
TABLE FILE EMPSQL SUM PAY BY LN BY FN WHERE LN EQ ' deFazio ' END Why Case Insensitivity Two Worlds: Selection DEFAZIO ANTHONY 30,000 SQL SELECT T1. " LN ",T1. " FN ", SUM(T1. " PAY “) FROM master.dbo.EMPSQL T1 WHERE (T1. " LN " = ' deFazio ‘) GROUP BY T1. " LN ",T1. " FN “ ORDER BY T1. " LN ",T1. " FN " ;
6
TABLE FILE EMPSQL PRINT FN PAY BY LN WHERE UPCASE(15,LN, ' A15 ‘) EQ ‘ DEFAZIO ' OR ‘ FAZIO ' END Why Case Insensitivity Two Worlds: Sorting DEFAZIO ANTHONY 10,000 DeFazio Anthony 10,000 FAZIO Anthony 9,000 Fazio Anthony 11,000 deFazio Anthony 10,000 Fazio Anthony 10,000
7
COLLATION Collation is defined as a set of rules that apply to the ordering and matching of all language elements that involve comparison of two values Why ? How? Problem?
8
BINARYBases collation sequence on binary values BINARYBases collation sequence on binary values SRV_CIBases collation sequence on LANGUAGE SRV_CIBases collation sequence on LANGUAGE Setting, and is INSENSITIVE SRV_CSBases collation sequence on LANGUAGE SRV_CSBases collation sequence on LANGUAGE Setting and is SENSITIVE CODEPAGEBases collation on the code page in effect, and is CODEPAGEBases collation on the code page in effect, and isSENSITIVE. SET COLLATION = BINARY SRV_CI SRV_CS CODEPAGE Collation is Settable Release 7.7
9
EBCDICASCII SENSITIVE>< INSENSITIVE== A ? a EBCDICASCII SENSITIVE>< INSENSITIVE<< A ? b EBCDICASCII SENSITIVE>< INSENSITIVE>< 1 ? A
10
TABLE FILE EMPSQL PRINT LN FN PAY WHERE LN EQ ' deFazio ' END SQL SELECT T1. " LN ",T1. " FN “,T1. " PAY " FROM master.dbo.EMPSQL T1 WHERE (T1. " LN " = ' deFazio ‘) ; DEFAZIO ANTHONY 10,000 deFazio Anthony 10,000 DeFazio Anthony 10,000 Insensitive Server Selection
11
TABLE FILE EMPSQL PRINT LN FN PAY BY LN WHERE LN EQ ‘ DeFazio ' OR ‘ Fazio ' END Insensitive Server Sorting DEFAZIO DEFAZIO ANTHONY 10,000 DeFazio Anthony 10,000 deFazio Anthony 10,000 Fazio Fazio Anthony 11,000 FAZIO Anthony 9,000 Fazio Anthony 10,000
12
Selection Why ? How? Problem?
13
TABLE FILE EMPSQL PRINT PAY BY LN BY FN WHERE LN EQ ‘defazio’ OR ‘fazio’ OR ‘deanna’ ON TABLE HOLD AS TEMP FORMAT ALPHA END Insensitive Server Temporary Files - FIXRETRIEVE Deanna Maria 25,000 DEFAZIO ANTHONY 10,000 DEFAZIO Anthony 10,000 Fazio Anthony 11,000 Fazio Anthony 9,000 Fazio Anthony 10,000
14
TABLE FILE TEMP PRINT PAY BY LN BY FN WHERE LN EQ ‘defazio’ END Insensitive Server Temporary Files Deanna Maria 25,000 DEFAZIO ANTHONY 10,000 DEFAZIO Anthony 10,000 Fazio Anthony 11,000 Fazio Anthony 9,000 Fazio Anthony 10,000 FIXRETRIEVE Would STOP here. If Server is set Case INSENSITIVE WHERE test is on an alpha “key” FIXRETRIEVE is set OFF
15
TABLE FILE EMPSQL PRINT PAY BY LN BY FN WHERE LN EQ ‘defazio’ OR ‘fazio’ OR ‘deanna’ ON TABLE HOLD AS TEMP1 FORMAT ALPHA END Insensitive Server JOIN Deanna Maria 25,000 DEFAZIO ANTHONY 10,000 DEFAZIO Anthony 10,000 Fazio Anthony 11,000 Fazio Anthony 9,000 Fazio Anthony 10,000
16
TABLE FILE EMP2 PRINT * END Insensitive Server JOIN deanna Maria 25,000 fazio Anthony 11,000 samuels Joseph 15,000 DEFAZIO ANTHONY 10,000 EMP2 file created in prior release (Case Sensitive)
17
JOIN LN IN EMP2 TO MULTIPLE LN IN TEMP AS AJ TABLE FILE EMP2 PRINT * END Insensitive Server JOIN to a Sequential File: Both files Must be in ascending order on COMMON KEY Correct sequence is determined by setting of collation. TABLE FILE EMP2 PRINT * BY LN ON TABLE HOLD AS EMP3 FORMAT FOCUS INDEX LN END JOIN LN IN EMP3 TO MULTIPLE LN IN TEMP AS AJ TABLE FILE EMP3 PRINT * END
18
Insensitive Server JOIN to FOCUS/FIX files to be reliable must Use numeric keys Use Keys that follow a specific pattern: Unnn Have been created using the same collation sequence. JOIN to (or selection from) case sensitive files to be reliable must Use numeric keys Use Keys that follow a specific pattern: Unnn Avoid indexes for selection.
19
The Sensitive World Come in and Stay Set it And Forget it
20
The Sensitive World Come in and Stay Why ? How? Problem? What’s Next ?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.