Skip to content

Commit

Permalink
[PlSql] Support modifying an Oracle column's visibility with alter ta…
Browse files Browse the repository at this point in the history
…ble (antlr#3620)
  • Loading branch information
Naros authored and wangxuesong committed Jul 21, 2023
1 parent a3210bb commit 351ba9c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sql/plsql/PlSqlParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -4910,7 +4910,9 @@ drop_column_clause

modify_column_clauses
: MODIFY ('(' modify_col_properties (',' modify_col_properties)* ')'
|'(' modify_col_visibility (',' modify_col_visibility)* ')'
| modify_col_properties
| modify_col_visibility
| modify_col_substitutable
)
;
Expand All @@ -4919,6 +4921,10 @@ modify_col_properties
: column_name datatype? (DEFAULT expression)? (ENCRYPT encryption_spec | DECRYPT)? inline_constraint* lob_storage_clause? //TODO alter_xmlschema_clause
;

modify_col_visibility
: column_name (VISIBLE | INVISIBLE)
;

modify_col_substitutable
: COLUMN column_name NOT? SUBSTITUTABLE AT ALL LEVELS FORCE?
;
Expand Down
5 changes: 5 additions & 0 deletions sql/plsql/examples/alter_table.sql
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,8 @@ ALTER TABLE employees NO MEMOPTIMIZE FOR WRITE
ENABLE VALIDATE CONSTRAINT emp_manager_fk
EXCEPTIONS INTO exceptions;

ALTER TABLE employees
MODIFY LAST_UPDATE_DATE invisible;

ALTER TABLE employees
MODIFY LAST_UPDATE_DATE visible;

0 comments on commit 351ba9c

Please sign in to comment.