Views are created with the sort sequence that was in effect when the CREATE VIEW statement was run.
When the view is referred to in a FROM clause, that sort sequence is used for any character comparisons in the subselect of the CREATE VIEW. At that time, an intermediate result table is produced from the view subselect. The sort sequence in effect when the query is being run is then applied to all the character and UCS-2 graphic comparisons (including those comparisons involving implicit conversions to character, or UCS-2 or UTF-16 graphic) specified in the query.
CREATE VIEW V1 AS SELECT * FROM STAFF WHERE JOB = 'MGR' AND ID < 100
ID | NAME | DEPT | JOB | YEARS | SALARY | COMM |
---|---|---|---|---|---|---|
10 | Sanders | 20 | Mgr | 7 | 18357.50 | 0 |
30 | Merenghi | 38 | MGR | 5 | 17506.75 | 0 |
50 | Hanes | 15 | Mgr | 10 | 20659.80 | 0 |
Any queries run against view V1 are run against the result table shown above. The query shown below is run with a sort sequence of SRTSEQ(*LANGIDUNQ) and LANGID(ENU).