Module Sqml_sqlstx (.ml)


module Sqml_sqlstx: sig .. end

exception Syntax_error of int * int * string
type query = query_exp * ordering list 
type query_exp = [ `select of select
| `union of query_exp * query_exp
| `unionall of query_exp * query_exp ]
type select = [ `all | `distinct | `nomod ] * selection * from *
where option * group_by option *
having option
type selection = [ `list of exp list | `star ] 
type from = [ `table of string | `tableas of string * string ] list 
type where = condition 
type group_by = column list 
type column = [ `ref of string | `refdotref of string * string ] 
type having = condition 
type condition = [ `cand of condition * condition
| `cnot of condition
| `cor of condition * condition
| `p of predicate ]
type predicate = [ `allorany of
exp * comparison * [ `all | `some ] *
select
| `between of bool * exp * exp * exp
| `comparisonexp of
exp * comparison * exp
| `comparisonselect of
exp * comparison * select
| `exists of select
| `in_atom_list of bool * exp * atom list
| `in_select of bool * exp * select
| `iscolnull of bool * column
| `like of
bool * exp * atom * atom option ]
type comparison = [ `eq | `gt | `gte | `lt | `lte | `neq ] 
type exp = [ `atom of atom
| `binop of
[ `div | `minus | `plus | `times ] * exp * exp
| `column of column
| `functioncall of functioncall
| `uminus of exp ]
type atom = [ `float of int * int * float
| `floattoomuch of string
| `int of int
| `inttoomuch of string
| `parameter of parameter
| `string of string
| `user ]
type functioncall = function_label *
[ `distinct of column
| `exp of [ `all | `nomod ] * exp
| `star ]
type function_label = [ `avg | `count | `max | `min | `other of string | `sum ] 
type parameter = [ `couple of string * string
| `indicator of string * string
| `single of string
| `single_annotated of string * string * string ]
type insert = string * string list *
[ `select of select
| `values of [ `atom of atom | `null ] list ]
type cmd = [ `manip of manipulative_statement
| `moduledef of moddef
| `privdef of privdef
| `schemadef of schemadef
| `tabledef of tabledef
| `viewdef of viewdef
| `when_not_found of when_action
| `whenever_sqlerror of when_action ]
type schemadef = string * schema_element list 
type schema_element = [ `privdef of privdef
| `tabledef of tabledef
| `viewdef of viewdef ]
type tabledef = string * table_element list 
type table_element = [ `columndef of columndef | `tblcnstr of tblcnstr ] 
type columndef = string * data_type * column_opt list 
type data_type = [ `char of int option
| `decimal of [ `default | `length of int | `lengthdec of int * int ]
| `doubleprecision
| `float of int option
| `int
| `numeric of [ `default | `length of int | `lengthdec of int * int ]
| `real
| `smallint ]
type literal = [ `int of int | `inttoomuch of string | `string of string ] 
type column_opt = [ `check of condition
| `default of literal
| `default_null
| `default_user
| `not_null
| `not_null_primary_key
| `not_null_unique
| `references of string * string list ]
type tblcnstr = [ `check of condition
| `foreignkey of string list * string * string list
| `primkey of string list
| `unique of string list ]
type viewdef = string * string list * select * [ `check | `nocheck ] 
type privdef = privilege * string * grantee list *
[ `grantoption | `nograntoption ]
type privilege = [ `all | `some of operation list ] 
type operation = [ `delete
| `insert
| `references of string list
| `select
| `update of string list ]
type grantee = [ `public | `user of string ] 
type moddef = string option * lang * string * cursor_def list *
procedure_def list
type lang = [ `ada | `c | `cobol | `fortran | `ocaml | `pascal | `pli ] 
type cursor_def = string * query_exp * ordering list 
type ordering = [ `column of column | `numcolumn of int ] *
[ `asc | `desc ] option
type procedure_def = string * parameter_def list *
manipulative_statement list
type parameter_def = [ `par of string * data_type | `sqlcode ] 
type manipulative_statement = [ `close of string
| `commit
| `delete_pos of string * string
| `delete_where of string * condition option
| `fetch of string * parameter list
| `insert of insert
| `opencursor of string
| `rollback
| `select of select * parameter list
| `update_pos of string * assignment list * string
| `update_where of
string * assignment list * condition option ]
type assignment = [ `column_exp of string * exp | `column_null of string ] 
type when_action = [ `continue | `goto of string ]