Skip to content
walter-weinmann edited this page Nov 24, 2018 · 32 revisions

plsql_block_sql_list:

    plsql_block_sql_list
             ::= plsql_block
               | sql_list

no references

plsql_block:

    plsql_block
             ::= plsql_body

referenced by:

sql_list:

    sql_list ::= ( sql ';' extra? )+

referenced by:

extra:

    extra    ::= NAME ';'

referenced by:

DBLINK:

    DBLINK   ::= '"@' [A-Za-z0-9_\$#.@]+ '"'

referenced by:

NAME:

    NAME     ::= [A-Za-z] [A-Za-z0-9_\$#@~]*

referenced by:

sql:

    sql      ::= manipulative_statement
               | schema

referenced by:

plsql_body:

    plsql_body
             ::= 'BEGIN' statement_pragma_list 'END' ';'

referenced by:

statement_pragma_list:

    statement_pragma_list
             ::= statement_pragma+

referenced by:

statement_pragma:

    statement_pragma
             ::= assign_statement
               | close_statement
               | commit_statement
               | cursor_def
               | delete_statement_positioned
               | delete_statement_searched
               | fetch_statement
               | function_ref
               | insert_statement
               | open_statement
               | procedure_call
               | rollback_statement
               | select_statement
               | update_statement_positioned
               | update_statement_searched
               | 'WHENEVER' ( 'NOT' 'FOUND' | 'SQLERROR' ) when_action

referenced by:

assignment_statement:

    assignment_statement
             ::= parameter ':=' scalar_opt_as_exp

no references

procedure_call:

    procedure_call
             ::= 'CALL' function_ref

referenced by:

schema:

    schema   ::= 'CREATE' 'SCHEMA' 'AUTHORIZATION' NAME schema_element*

referenced by:

schema_element:

    schema_element
             ::= create_table_def
               | view_def
               | grant_def

referenced by:

create_role_def:

    create_role_def
             ::= 'CREATE' 'ROLE' NAME

referenced by:

create_table_def:

    create_table_def
             ::= 'CREATE' tbl_scope? tbl_type? 'TABLE' table '(' ( base_table_element ( ',' base_table_element )* )? ')'

referenced by:

create_user_def:

    create_user_def
             ::= 'CREATE' 'USER' NAME identified user_opt*

referenced by:

drop_table_def:

    drop_table_def
             ::= 'DROP' NAME? 'TABLE' ( 'IF' 'EXISTS' )? table ( ',' table )* ( 'RESTRICT' | 'CASCADE' )?

referenced by:

drop_role_def:

    drop_role_def
             ::= 'DROP' 'ROLE' NAME

referenced by:

drop_index_def:

    drop_index_def
             ::= 'DROP' 'INDEX' ( index_name? 'FROM' table | index_name )

referenced by:

index_name:

    index_name
             ::= NAME ( '.' NAME )?

referenced by:

create_index_def:

    create_index_def
             ::= 'CREATE' ( 'BITMAP' | 'KEYLIST' | 'HASHMAP' | 'UNIQUE' )? 'INDEX' index_name? 'ON' table_alias ( '(' NAME JSON? ( ',' NAME JSON? )* ')' )? ( 'NORM_WITH' STRING )? ( 'FILTER_WITH' STRING )?

referenced by:

JSON:

    JSON     ::= '|' [:{\[#] [^|]+ '|'

referenced by:

STRING:

    STRING   ::= 'fun' [A-Za-z0-9,_]* '.'* '->' '.'* 'end.'
               | 'fun\s' ['A-Za-z0-9_]+ ':' ['A-Za-z0-9_]+ '/' [0-9]+ '.'
               | "'" [^\']* "''**"

referenced by:

tbl_scope:

    tbl_scope
             ::= 'LOCAL'
               | 'CLUSTER'
               | 'SCHEMA'

referenced by:

tbl_type:

    tbl_type ::= 'SET'
               | 'ORDERED_SET'
               | 'BAG'
               | NAME

referenced by:

alter_user_def:

    alter_user_def
             ::= 'ALTER' 'USER' NAME ( ( ',' NAME )* proxy_clause | spec_item+ | NAME NAME )

referenced by:

drop_user_def:

    drop_user_def
             ::= 'DROP' 'USER' NAME 'CASCADE'?

referenced by:

proxy_clause:

    proxy_clause
             ::= ( 'GRANT' | 'REVOKE' ) 'CONNECT' 'THROUGH' ( 'ENTERPRISE' 'USERS' | db_user_proxy )

referenced by:

db_user_proxy:

    db_user_proxy
             ::= proxy_with
               | proxy_with? 'AUTHENTICATION' 'REQUIRED'

referenced by:

proxy_with:

    proxy_with
             ::= 'WITH' ( 'NO' 'ROLES' | 'ROLE' ( 'ALL' 'EXCEPT' )? role_list )

referenced by:

spec_item:

    spec_item
             ::= identified
               | user_opt
               | user_role

referenced by:

user_role:

    user_role
             ::= 'DEFAULT' 'ROLE' ( 'ALL' ( 'EXCEPT' role_list )? | NONE | role_list )

referenced by:

role_list:

    role_list
             ::= NAME ( ',' NAME )*

referenced by:

identified:

    identified
             ::= IDENTIFIED ( ( 'BY' | EXTERNALLY 'AS' ) NAME | 'GLOBALLY' ( 'AS' NAME )? )

referenced by:

user_opt:

    user_opt ::= ( ( 'DEFAULT' | 'TEMPORARY' ) 'TABLESPACE' | 'PROFILE' ) NAME
               | quota+

referenced by:

quota:

    quota    ::= 'QUOTA' ( 'UNLIMITED' | INTNUM NAME? ) 'ON' NAME

referenced by:

INTNUM:

    INTNUM   ::= [0-9]+

referenced by:

base_table_element:

    base_table_element
             ::= column_def
               | table_constraint_def

referenced by:

column_def:

    column_def
             ::= column data_type column_def_opt*

referenced by:

column_def_opt:

    column_def_opt
             ::= 'NOT' 'NULL' ( 'UNIQUE' | 'PRIMARY' 'KEY' )?
               | 'DEFAULT' ( function_ref | literal | NAME | 'NULL' | 'USER' )
               | 'CHECK' '(' search_condition ')'
               | 'REFERENCES' table ( '(' column_commalist ')' )?

referenced by:

table_constraint_def:

    table_constraint_def
             ::= ( ( ( 'CONSTRAINT' NAME )? 'UNIQUE' | 'PRIMARY' 'KEY' ) '(' column_commalist | 'CHECK' '(' search_condition ) ')'
               | 'FOREIGN' 'KEY' '(' column_commalist ')' 'REFERENCES' table ( '(' column_commalist ')' )?

referenced by:

column_commalist:

    column_commalist
             ::= column ( ',' column )*

referenced by:

view_def:

    view_def ::= 'CREATE' 'VIEW' table ( '(' column_commalist ')' )? 'AS' query_spec ( 'WITH' 'CHECK' 'OPTION' )?

referenced by:

grant_def:

    grant_def
             ::= 'GRANT' ( ( 'All' 'PRIVILEGES' | object_privilege ( ',' object_privilege )* ) on_obj_clause 'TO' ( grantee_identified_by | grantee_revokee ( ',' grantee_revokee )* ) ( 'WITH' ( 'GRANT' | 'HIERARCHY' ) 'OPTION' )? | ( 'All' 'PRIVILEGES' | system_privilege ( ',' system_privilege )* ) 'TO' ( grantee_identified_by | grantee_revokee ( ',' grantee_revokee )* ) ( 'WITH' ( 'ADMIN' | 'DELEGATE' ) 'OPTION' )? )

referenced by:

revoke_def:

    revoke_def
             ::= 'REVOKE' ( ( 'All' 'PRIVILEGES' | object_privilege ( ',' object_privilege )* ) on_obj_clause 'FROM' grantee_revokee ( ',' grantee_revokee )* ( 'CASCADE' 'CONSTRAINTS' | 'FORCE' )? | ( 'All' 'PRIVILEGES' | system_privilege ( ',' system_privilege )* ) 'FROM' grantee_revokee ( ',' grantee_revokee )* )

referenced by:

object_privilege:

    object_privilege
             ::= 'ALL'
               | 'ALTER'
               | 'DELETE'
               | 'EXECUTE'
               | 'INDEX'
               | 'INSERT'
               | 'REFERENCES'
               | 'SELECT'
               | 'UPDATE'

referenced by:

on_obj_clause:

    on_obj_clause
             ::= 'ON' ( table | 'DIRECTORY' NAME )

referenced by:

system_privilege:

    system_privilege
             ::= 'ADMIN'
               | 'ALL'
               | ( 'ALTER' | 'CREATE' | 'DROP' ) 'ANY' ( 'INDEX' | 'MATERIALIZED'? 'VIEW' | 'TABLE' )
               | 'CREATE' ( 'MATERIALIZED'? 'VIEW' | 'TABLE' )
               | ( 'DELETE' | 'INSERT' | 'SELECT' | 'UPDATE' ) 'ANY' 'TABLE'
               | NAME

referenced by:

grantee_revokee:

    grantee_revokee
             ::= NAME
               | 'PUBLIC'

referenced by:

grantee_identified_by:

    grantee_identified_by
             ::= NAME 'IDENTIFIED' 'BY' STRING

referenced by:

cursor_def:

    cursor_def
             ::= 'CURSOR' cursor 'IS' query_exp

referenced by:

order_by_clause:

    order_by_clause
             ::= 'ORDER' 'BY' ordering_spec ( ',' ordering_spec )*

referenced by:

ordering_spec:

    ordering_spec
             ::= scalar_exp ( 'ASC' | 'DESC' )?

referenced by:

manipulative_statement:

    manipulative_statement
             ::= alter_user_def
               | create_index_def
               | create_role_def
               | create_table_def
               | create_user_def
               | delete_statement_positioned
               | delete_statement_searched
               | drop_index_def
               | drop_role_def
               | drop_table_def
               | drop_user_def
               | grant_def
               | insert_statement
               | revoke_def
               | select_statement
               | truncate_table
               | update_statement_positioned
               | update_statement_searched
               | view_def

referenced by:

truncate_table:

    truncate_table
             ::= 'TRUNCATE' 'TABLE' table ( ( 'PRESERVE' | 'PURGE' ) 'MATERIALIZED' 'VIEW' 'LOG' )? ( ( 'DROP' | 'REUSE' ) 'STORAGE' )?

referenced by:

close_statement:

    close_statement
             ::= 'CLOSE' cursor

referenced by:

commit_statement:

    commit_statement
             ::= 'COMMIT' 'WORK'?

referenced by:

delete_statement_positioned:

    delete_statement_positioned
             ::= 'DELETE' 'FROM' table_dblink 'WHERE' 'CURRENT' 'OF' cursor returning?

referenced by:

delete_statement_searched:

    delete_statement_searched
             ::= 'DELETE' 'FROM' table_dblink where_clause? returning?

referenced by:

fetch_statement:

    fetch_statement
             ::= 'FETCH' cursor 'INTO' target_commalist

referenced by:

insert_statement:

    insert_statement
             ::= 'INSERT' 'INTO' table_table_alias ( ( '(' column_commalist ')' )? ( ( 'VALUES' '(' scalar_opt_as_exp ( ',' scalar_opt_as_exp )* | '(' query_spec ) ')' | query_spec ) returning? )?

referenced by:

open_statement:

    open_statement
             ::= 'OPEN' cursor

referenced by:

rollback_statement:

    rollback_statement
             ::= 'ROLLBACK' 'WORK'?

referenced by:

select_statement:

    select_statement
             ::= query_exp

referenced by:

update_statement_positioned:

    update_statement_positioned
             ::= 'UPDATE' table_dblink 'SET' assignment_commalist 'WHERE' 'CURRENT' 'OF' cursor returning?

referenced by:

assignment_commalist:

    assignment_commalist
             ::= assignment ( ',' assignment )*

referenced by:

assignment:

    assignment
             ::= column '=' scalar_opt_as_exp

referenced by:

update_statement_searched:

    update_statement_searched
             ::= 'UPDATE' table_dblink 'SET' assignment_commalist where_clause? returning?

referenced by:

target_commalist:

    target_commalist
             ::= target ( ',' target )*

referenced by:

target:

    target   ::= NAME
               | parameter_ref

referenced by:

query_exp:

    query_exp
             ::= query_term ( ( 'UNION' 'ALL'? | 'INTERSECT' | 'MINUS' ) query_term )*

referenced by:

returning:

    returning
             ::= ( 'RETURNING' | 'RETURN' ) selection 'INTO' selection

referenced by:

query_term:

    query_term
             ::= query_spec
               | '(' query_exp ')' JSON?

referenced by:

query_spec:

    query_spec
             ::= 'SELECT' HINT? ( 'ALL' | 'DISTINCT' )? selection ( 'INTO' target_commalist )? table_exp

referenced by:

HINT:

    HINT     ::= '/*' [^\*/]* '*/'

referenced by:

selection:

    selection
             ::= select_field_commalist

referenced by:

select_field:

    select_field
             ::= case_when_exp ( 'AS'? NAME )?
               | scalar_opt_as_exp
               | '*'

referenced by:

select_field_commalist:

    select_field_commalist
             ::= select_field ( ',' select_field )*

referenced by:

case_when_exp:

    case_when_exp
             ::= '(' case_when_exp ')'
               | 'CASE' scalar_opt_as_exp? case_when_then_list ( 'ELSE' scalar_opt_as_exp )? 'END'

referenced by:

case_when_then_list:

    case_when_then_list
             ::= case_when_then+

referenced by:

case_when_then:

    case_when_then
             ::= 'WHEN' search_condition 'THEN' scalar_opt_as_exp

referenced by:

from_column:

    from_column
             ::= table_ref
               | '(' join_clause ')'
               | join_clause

referenced by:

table_exp:

    table_exp
             ::= 'FROM' from_column+ where_clause? hierarchical_query_clause? ( 'GROUP' 'BY' column_ref_commalist )? ( 'HAVING' search_condition )? order_by_clause?

referenced by:

join:

    join     ::= inner_cross_join
               | outer_join

referenced by:

join_clause:

    join_clause
             ::= table_ref join+

referenced by:

inner_cross_join:

    inner_cross_join
             ::= 'INNER'? 'JOIN' join_ref join_on_or_using_clause
               | ( 'CROSS' | 'NATURAL' 'INNER'? ) 'JOIN' join_ref

referenced by:

join_on_or_using_clause:

    join_on_or_using_clause
             ::= 'ON' search_condition
               | 'USING' '(' select_field_commalist ')'

referenced by:

outer_join:

    outer_join
             ::= query_partition_clause? 'NATURAL'? outer_join_type 'JOIN' join_ref query_partition_clause? join_on_or_using_clause?

referenced by:

query_partition_clause:

    query_partition_clause
             ::= 'PARTITION' 'BY' ( '(' scalar_exp_commalist ')' | scalar_exp_commalist )

referenced by:

outer_join_type:

    outer_join_type
             ::= ( 'FULL' | 'LEFT' | 'RIGHT' ) 'OUTER'?

referenced by:

table_ref:

    table_ref
             ::= table_dblink
               | query_term NAME?

referenced by:

join_ref:

    join_ref ::= table_dblink
               | query_term NAME?

referenced by:

hierarchical_query_clause:

    hierarchical_query_clause
             ::= ( 'START' 'WITH' search_condition 'CONNECT' 'BY' 'NOCYCLE'? | 'CONNECT' 'BY' 'NOCYCLE'? search_condition 'START' 'WITH' ) search_condition

referenced by:

where_clause:

    where_clause
             ::= 'WHERE' search_condition

referenced by:

column_ref_commalist:

    column_ref_commalist
             ::= ( column_ref | function_ref ) ( ',' ( column_ref | function_ref ) )*

referenced by:

search_condition:

    search_condition
             ::= ( search_condition ( 'AND' | 'OR' ) | 'NOT' ) search_condition
               | '(' search_condition ')'
               | predicate

referenced by:

predicate:

    predicate
             ::= comparison_predicate
               | between_predicate
               | like_predicate
               | test_for_null
               | in_predicate
               | all_or_any_predicate
               | existence_test

referenced by:

comparison_predicate:

    comparison_predicate
             ::= scalar_opt_as_exp
               | ( scalar_exp ( '=' | COMPARISON ) 'PRIOR' | 'PRIOR' scalar_exp ( '=' | COMPARISON ) ) scalar_exp

referenced by:

COMPARISON:

    COMPARISON
             ::= '!='
               | '^='
               | '<>'
               | '<'
               | '>'
               | '<='
               | '>='

referenced by:

between_predicate:

    between_predicate
             ::= scalar_exp 'NOT'? 'BETWEEN' scalar_exp 'AND' scalar_exp

referenced by:

like_predicate:

    like_predicate
             ::= scalar_exp 'NOT'? 'LIKE' scalar_exp ( 'ESCAPE' atom )?

referenced by:

test_for_null:

    test_for_null
             ::= scalar_exp 'IS' 'NOT'? 'NULL'

referenced by:

in_predicate:

    in_predicate
             ::= scalar_exp 'NOT'? 'IN' ( '(' ( subquery | scalar_exp_commalist ) ')' | scalar_exp )

referenced by:

all_or_any_predicate:

    all_or_any_predicate
             ::= scalar_exp ( '=' | COMPARISON ) ( 'ANY' | 'ALL' | 'SOME' ) subquery

referenced by:

existence_test:

    existence_test
             ::= 'EXISTS' subquery

referenced by:

table_coll_expr:

    table_coll_expr
             ::= TABLE '(' ( column_ref | function_ref | subquery ) ')'

referenced by:

subquery:

    subquery ::= query_exp

referenced by:

scalar_opt_as_exp:

    scalar_opt_as_exp
             ::= scalar_exp ( ( '=' | COMPARISON ) scalar_exp | AS? NAME )?

referenced by:

scalar_exp:

    scalar_exp
             ::= scalar_sub_exp ( '||' scalar_sub_exp )*

referenced by:

scalar_sub_exp:

    scalar_sub_exp
             ::= ( scalar_sub_exp ( '+' | '-' | '*' | '/' | 'div' ) | '+' | '-' ) scalar_sub_exp
               | 'NULL'
               | atom
               | subquery
               | column_ref
               | function_ref
               | '(' scalar_sub_exp ')' JSON?

referenced by:

scalar_exp_commalist:

    scalar_exp_commalist
             ::= scalar_opt_as_exp ( ',' scalar_opt_as_exp )*

referenced by:

atom:

    atom     ::= parameter_ref
               | literal
               | 'USER'

referenced by:

parameter_ref:

    parameter_ref
             ::= parameter ( 'INDICATOR'? parameter )?

referenced by:

function_ref:

    function_ref
             ::= ( NAME ( '.' NAME ( '.' NAME )? )? '(' ( fun_args | fun_args_named )? ')' | 'FUNS' ( '(' ( fun_args | fun_args_named | '*' | 'DISTINCT' column_ref | 'ALL' scalar_exp )? ')' )? ) JSON*

referenced by:

fun_args:

    fun_args ::= fun_arg ( ',' fun_arg )*

referenced by:

fun_arg:

    fun_arg  ::= '(' fun_arg ')'
               | atom
               | case_when_exp
               | column_ref
               | fun_arg ( 'AS'? NAME | ( '*' | '+' | '-' | '/' | '=' | 'div' | '||' | COMPARISON ) fun_arg )
               | function_ref
               | 'NULL'
               | subquery
               | ( '+' | '-' ) fun_arg

referenced by:

fun_args_named:

    fun_args_named
             ::= fun_arg_named ( ',' fun_arg_named )*

referenced by:

fun_arg_named:

    fun_arg_named
             ::= NAME '=>' ( literal | NAME | parameter )

referenced by:

literal:

    literal  ::= STRING
               | INTNUM
               | APPROXNUM

referenced by:

APPROXNUM:

    APPROXNUM
             ::= ( '.' [0-9] | [0-9]+ '.'? ) [0-9]* ( [eE] [+#x2D]? [0-9]+ )? [fFdD]?

referenced by:

table:

    table    ::= NAME ( '.' NAME )?
               | parameter
               | STRING

referenced by:

table_alias:

    table_alias
             ::= ( NAME ( '.' NAME )? | parameter | STRING ) NAME
               | table

referenced by:

table_dblink:

    table_dblink
             ::= ( NAME ( '.' NAME )? | parameter ) DBLINK NAME?
               | table_alias
               | table_coll_expr

referenced by:

column_ref:

    column_ref
             ::= ( NAME ( '.' NAME ( '.' NAME )? )? )? JSON
               | NAME ( ( '.' NAME ( '.' NAME )? )? ( '(' '+' ')' )? | '.' ( NAME '.' )? '*' )

referenced by:

data_type:

    data_type
             ::= STRING
               | NAME ( '(' sgn_num ( ',' sgn_num )? ')' )?

referenced by:

sgn_num:

    sgn_num  ::= '-'? INTNUM

referenced by:

column:

    column   ::= NAME
               | STRING

referenced by:

cursor:

    cursor   ::= NAME

referenced by:

parameter:

    parameter
             ::= PARAMETER

referenced by:

PARAMETER:

    PARAMETER
             ::= ':' [A-Za-z0-9_\.]+

referenced by:

when_action:

    when_action
             ::= 'GOTO' NAME
               | 'CONTINUE'

referenced by:



  ... generated by Railroad Diagram Generator{.signature}


Clone this wiki locally