urQL/docs/alter.md

77 lines
1.7 KiB
Markdown
Raw Normal View History

2022-08-10 23:23:12 +03:00
```
ALTER INDEX [ <db-qualifer> ]{ <index-name> }
ON { <table-name> | <view-name> }
[ ( <column-name> [ ASC | DESC ] [ ,...n ] ) ]
2022-08-10 23:23:12 +03:00
{ REBUILD | DISABLE | RESUME}
```
2022-08-06 17:06:18 +03:00
Discussion:
2022-08-10 21:45:17 +03:00
`RESUME` will rebuild the index if the underlying object is dirty.
2022-08-06 17:06:18 +03:00
### _______________________________
2022-08-10 23:23:12 +03:00
```
ALTER NAMESPACE [ <database-name>. ]<namespace-name>
TRANSFER { TABLE | VIEW } [ <db-qualifer> ]{ <table-name> | <view-name> }
```
2022-08-10 21:45:17 +03:00
Discussion:
The namespace *sys* cannot be altered, nor can objects be transferred out of it.
2022-08-06 17:06:18 +03:00
### _______________________________
```
ALTER { PROC | PROCEDURE }
[<db-qualifer>]<procedure-name>
[ { #<parameter-name> <data-type> } ] [ ,...n ]
AS { sql_statement [ ;...n ] }
```
Discussion:
TBD
### _______________________________
2022-08-10 23:23:12 +03:00
```
ALTER TABLE [ <db-qualifer> ]{ <table-name> }
2022-09-10 20:02:00 +03:00
{ ALTER COLUMN ( { <column-name> <aura> } [ ,... n ] )
| ADD COLUMN ( { <column-name> <aura> } [ ,... n ] )
| DROP COLUMN ( { <column-name> } [ ,... n ] )
2022-08-10 23:23:12 +03:00
| ADD FOREIGN KEY <foreign-key-name> (<column-name> [ ,... n ])
REFERENCES [<namespace-name>.]<table-name> ( <column-name> [ ,... n ])
[ ON DELETE { NO ACTION | CASCADE } ]
[ ON UPDATE { NO ACTION | CASCADE } ]
2022-08-10 23:23:12 +03:00
[ ,... n ]
2022-09-10 20:02:00 +03:00
| DROP FOREIGN KEY ( <foreign-key-name> [ ,... n ] } )
2022-08-10 23:23:12 +03:00
```
2022-08-06 17:06:18 +03:00
Example:
2022-08-10 23:23:12 +03:00
```
ALTER TABLE my-table
DROP FOREIGN KEY fk-1, fk-2
```
2022-08-06 17:06:18 +03:00
### _______________________________
2022-08-10 23:23:12 +03:00
```
ALTER TRIGGER { [ <db-qualifer> ]{ <trigger-name> } | ALL ]
ON { SERVER | <database.name> | <table-name> | <view-name> }
[ ENABLE | DISABLE ]
```
2022-08-06 17:06:18 +03:00
TBD
2022-08-10 21:45:17 +03:00
Discussion:
Not for initial release.
2022-08-06 17:06:18 +03:00
### _______________________________
2022-08-10 23:23:12 +03:00
```
ALTER VIEW [ <db-qualifer> ]{ <view-name> }
( { [<alias>.] <column-name> } [ ,...n ] )
AS <select_statement>
```