2 " Language: SQL, PL/SQL (Oracle 8i)
3 " Maintainer: Paul Moore <gustav@morpheus.demon.co.uk>
4 " Last Change: 2001 Apr 30
6 " For version 5.x: Clear all syntax items
7 " For version 6.x: Quit when a syntax file was already loaded
10 elseif exists("b:current_syntax")
16 " The SQL reserved words, defined as keywords.
18 syn keyword sqlSpecial false null true
20 syn keyword sqlKeyword access add as asc begin by check cluster column
21 syn keyword sqlKeyword compress connect current cursor decimal default desc
22 syn keyword sqlKeyword else elsif end exception exclusive file for from
23 syn keyword sqlKeyword function group having identified if immediate increment
24 syn keyword sqlKeyword index initial into is level loop maxextents mode modify
25 syn keyword sqlKeyword nocompress nowait of offline on online start
26 syn keyword sqlKeyword successful synonym table then to trigger uid
27 syn keyword sqlKeyword unique user validate values view whenever
28 syn keyword sqlKeyword where with option order pctfree privileges procedure
29 syn keyword sqlKeyword public resource return row rowlabel rownum rows
30 syn keyword sqlKeyword session share size smallint type using
32 syn keyword sqlOperator not and or
33 syn keyword sqlOperator in any some all between exists
34 syn keyword sqlOperator like escape
35 syn keyword sqlOperator union intersect minus
36 syn keyword sqlOperator prior distinct
37 syn keyword sqlOperator sysdate out
39 syn keyword sqlStatement alter analyze audit comment commit create
40 syn keyword sqlStatement delete drop execute explain grant insert lock noaudit
41 syn keyword sqlStatement rename revoke rollback savepoint select set
42 syn keyword sqlStatement truncate update
44 syn keyword sqlType boolean char character date float integer long
45 syn keyword sqlType mlslabel number raw rowid varchar varchar2 varray
47 " Strings and characters:
48 syn region sqlString start=+"+ skip=+\\\\\|\\"+ end=+"+
49 syn region sqlString start=+'+ skip=+\\\\\|\\'+ end=+'+
52 syn match sqlNumber "-\=\<\d*\.\=[0-9_]\>"
55 syn region sqlComment start="/\*" end="\*/"
56 syn match sqlComment "--.*"
58 syn sync ccomment sqlComment
60 " Define the default highlighting.
61 " For version 5.7 and earlier: only when not done already
62 " For version 5.8 and later: only when an item doesn't have highlighting yet
63 if version >= 508 || !exists("did_sql_syn_inits")
65 let did_sql_syn_inits = 1
66 command -nargs=+ HiLink hi link <args>
68 command -nargs=+ HiLink hi def link <args>
71 HiLink sqlComment Comment
72 HiLink sqlKeyword sqlSpecial
73 HiLink sqlNumber Number
74 HiLink sqlOperator sqlStatement
75 HiLink sqlSpecial Special
76 HiLink sqlStatement Statement
77 HiLink sqlString String
83 let b:current_syntax = "sql"