" Vim syntax file
" Language:	SQL (Oracle 7)
" Maintainer:	Paul Moore <gustav@morpheus.demon.co.uk>
" Last change:	1997 April 20

" Remove any old syntax stuff hanging around
syntax clear

syntax case ignore

" The SQL reserved words, defined as keywords.

syntax keyword sqlSpecial   null

syntax keyword sqlKeyword	access add as asc by check cluster column
syntax keyword sqlKeyword	compress connect current decimal default
syntax keyword sqlKeyword	desc else exclusive file for from group
syntax keyword sqlKeyword	having identified immediate increment index
syntax keyword sqlKeyword	initial into is level maxextents mode modify
syntax keyword sqlKeyword	nocompress nowait of offline on online start
syntax keyword sqlKeyword	successful synonym table then to trigger uid
syntax keyword sqlKeyword	unique user validate values view whenever
syntax keyword sqlKeyword	where with option order pctfree privileges
syntax keyword sqlKeyword	public resource row rowlabel rownum rows
syntax keyword sqlKeyword	session share size smallint

syntax keyword sqlOperator	not and or
syntax keyword sqlOperator	in any some all between exists
syntax keyword sqlOperator	like escape
syntax keyword sqlOperator  union intersect minus
syntax keyword sqlOperator  prior distinct
syntax keyword sqlOperator	sysdate

syntax keyword sqlStatement	alter analyze audit comment commit create
syntax keyword sqlStatement	delete drop explain grant insert lock noaudit
syntax keyword sqlStatement	rename revoke rollback savepoint select set
syntax keyword sqlStatement truncate update

syntax keyword sqlType		char character date long raw mlslabel number
syntax keyword sqlType		rowid varchar varchar2 float integer

" Strings and characters:
syntax region sqlString		start=+"+  skip=+\\\\\|\\"+  end=+"+
syntax region sqlString		start=+'+  skip=+\\\\\|\\"+  end=+'+

" Numbers:
syntax match sqlNumber		"-\=\<[0-9]*\.\=[0-9_]\>"

" Comments:
syntax region sqlComment    start="/\*"  end="\*/"
syntax match sqlComment 	"--.*"

syntax sync ccomment sqlComment

if !exists("did_sql_syntax_inits")
  let did_sql_syntax_inits = 1
  " The default methods for highlighting. Can be overridden later.
  highlight link sqlComment	Comment
  highlight link sqlKeyword	sqlSpecial
  highlight link sqlNumber	Number
  highlight link sqlOperator	sqlStatement
  highlight link sqlSpecial	Special
  highlight link sqlStatement	Statement
  highlight link sqlString	String
  highlight link sqlType	Type
endif
