TOP をテンプレートにして作成
ホーム
バックアップ
一覧
検索
最終更新
ヘルプ
ログイン
開始行
Data Definition Language (DDL)
Table of Contents
New and Enhanced Syntaxes
New and Enhanced Syntaxes
CREATE SEQUENCE
REVOKE ADMIN OPTION FROM
SET/DROP DEFAULT Clauses for ALTER TABLE
New Syntaxes for Changing Exceptions
ALTER EXTERNAL FUNCTION
COMMENT Statement Implemented
Extensions to CREATE VIEW Specification
RECREATE TRIGGER Statement Implemented
Usage Enhancements
The following statement syntaxes and structures have been...
CREATE SEQUENCE
D. Yemanov
SEQUENCE has been introduced as a synonym for GENERATOR, ...
A sequence generator is a mechanism for generating succes...
Syntax patterns
CREATE { SEQUENCE | GENERATOR } <name>
DROP { SEQUENCE | GENERATOR } <name>
SET GENERATOR <name> TO <start_value>
ALTER SEQUENCE <name> RESTART WITH <start_value>
GEN_ID (<name>, <increment_value>)
NEXT VALUE FOR <name>
Examples
1.
CREATE SEQUENCE S_EMPLOYEE;
2.
ALTER SEQUENCE S_EMPLOYEE RESTART WITH 0;
See also the notes about NEXT VALUE FOR.
Warning
ALTER SEQUENCE, like SET GENERATOR, is a good way to scre...
REVOKE ADMIN OPTION FROM
D. Yemanov
SYSDBA, the database creator or the owner of an object ca...
However, there's a second form that involves roles. Inste...
By using WITH ADMIN OPTION, the grantor (typically the ro...
SET/DROP DEFAULT Clauses for ALTER TABLE
C. Valderrama
Domains allow their defaults to be changed or dropped. It...
Syntax Pattern
ALTER TABLE t ALTER [COLUMN] c SET DEFAULT default_value;
ALTER TABLE t ALTER [COLUMN] c DROP DEFAULT;
Note
Array fields cannot have a default value.
If you change the type of a field, the default may remain...
New Syntaxes for Changing Exceptions
D. Yemanov
The DDL statements RECREATE EXCEPTION and CREATE OR ALTER...
RECREATE EXCEPTION
RECREATE EXCEPTION is exactly like CREATE EXCEPTION if th...
CREATE OR ALTER EXCEPTION
CREATE OR ALTER EXCEPTION will create the exception if it...
ALTER EXTERNAL FUNCTION
C. Valderrama
ALTER EXTERNAL FUNCTION has been implemented, to enable t...
COMMENT Statement Implemented
C. Valderrama
The COMMENT statement has been implemented for setting me...
Syntax Pattern
COMMENT ON DATABASE IS {'txt'|NULL};
COMMENT ON <basic_type> name IS {'txt'|NULL};
COMMENT ON COLUMN tblviewname.fieldname IS {'txt'|NULL};
COMMENT ON PARAMETER procname.parname IS {'txt'|NULL};
An empty literal string '' will act as NULL since the int...
<basic_type>:
DOMAIN
TABLE
VIEW
PROCEDURE
TRIGGER
EXTERNAL FUNCTION
FILTER
EXCEPTION
GENERATOR
SEQUENCE
INDEX
ROLE
CHARACTER SET
COLLATION
SECURITY CLASS1
1not implemented, because this type is hidden.
Extensions to CREATE VIEW Specification
D. Yemanov
FIRST/SKIP and ROWS syntaxes and PLAN and ORDER BY clause...
From Firebird 2.0 onward, views are treated as fully-feat...
Syntax
For syntax details, refer to Select Statement & Expressio...
RECREATE TRIGGER Statement Implemented
D. Yemanov
The DDL statement RECREATE TRIGGER statement is now avail...
Usage Enhancements
The following changes will affect usage or existing, pre-...
Creating Foreign Key Constraints No Longer Requires Exclu...
V. Horsun
Now it is possible to create foreign key constraints with...
Changed Logic for View Updates
Apply NOT NULL constraints to base tables only, ignoring ...
Declare BLOB Subtypes by Known Descriptive Identifiers
A. Peshkov, C. Valderrama
Previously, the only allowed syntax for declaring a blob ...
declare filter <name> input_type <number> output_type ...
entry_point <function_in_library> module_name <libra...
The alternative new syntax is:
declare filter <name> input_type <mnemonic> output_typ...
entry_point <function_in_library> module_name <libra...
where <mnemonic> refers to a subtype identifier known to ...
Initially they are binary, text and others mostly for int...
To get the predefined types, do
select RDB$TYPE, RDB$TYPE_NAME, RDB$SYSTEM_FLAG
from rdb$types
where rdb$field_name = 'RDB$FIELD_SUB_TYPE';
RDB$TYPE RDB$TYPE_NAME RDB$SYSTEM_FLAG
========= ============================ =================
0 BINARY 1
1 TEXT 1
2 BLR 1
3 ACL 1
4 RANGES 1
5 SUMMARY 1
6 FORMAT 1
7 TRANSACTION_DESCRIPTION 1
8 EXTERNAL_FILE_DESCRIPTION 1
Examples
Original declaration:
declare filter pesh input_type 0 output_type 3
entry_point 'f' module_name 'p';
Alternative declaration:
declare filter pesh input_type binary output_type acl
entry_point 'f' module_name 'p';
Declaring a name for a user defined blob subtype (remembe...
SQL> insert into rdb$types
CON> values('RDB$FIELD_SUB_TYPE', -100, 'XDR', 'test ty...
SQL> commit;
SQL> declare filter pesh2 input_type xdr output_type text
CON> entry_point 'p2' module_name 'p';
SQL> show filter pesh2;
BLOB Filter: PESH2
Input subtype: -100 Output subtype: 1
Filter library is p
Entry point is p2
最終行:
Data Definition Language (DDL)
Table of Contents
New and Enhanced Syntaxes
New and Enhanced Syntaxes
CREATE SEQUENCE
REVOKE ADMIN OPTION FROM
SET/DROP DEFAULT Clauses for ALTER TABLE
New Syntaxes for Changing Exceptions
ALTER EXTERNAL FUNCTION
COMMENT Statement Implemented
Extensions to CREATE VIEW Specification
RECREATE TRIGGER Statement Implemented
Usage Enhancements
The following statement syntaxes and structures have been...
CREATE SEQUENCE
D. Yemanov
SEQUENCE has been introduced as a synonym for GENERATOR, ...
A sequence generator is a mechanism for generating succes...
Syntax patterns
CREATE { SEQUENCE | GENERATOR } <name>
DROP { SEQUENCE | GENERATOR } <name>
SET GENERATOR <name> TO <start_value>
ALTER SEQUENCE <name> RESTART WITH <start_value>
GEN_ID (<name>, <increment_value>)
NEXT VALUE FOR <name>
Examples
1.
CREATE SEQUENCE S_EMPLOYEE;
2.
ALTER SEQUENCE S_EMPLOYEE RESTART WITH 0;
See also the notes about NEXT VALUE FOR.
Warning
ALTER SEQUENCE, like SET GENERATOR, is a good way to scre...
REVOKE ADMIN OPTION FROM
D. Yemanov
SYSDBA, the database creator or the owner of an object ca...
However, there's a second form that involves roles. Inste...
By using WITH ADMIN OPTION, the grantor (typically the ro...
SET/DROP DEFAULT Clauses for ALTER TABLE
C. Valderrama
Domains allow their defaults to be changed or dropped. It...
Syntax Pattern
ALTER TABLE t ALTER [COLUMN] c SET DEFAULT default_value;
ALTER TABLE t ALTER [COLUMN] c DROP DEFAULT;
Note
Array fields cannot have a default value.
If you change the type of a field, the default may remain...
New Syntaxes for Changing Exceptions
D. Yemanov
The DDL statements RECREATE EXCEPTION and CREATE OR ALTER...
RECREATE EXCEPTION
RECREATE EXCEPTION is exactly like CREATE EXCEPTION if th...
CREATE OR ALTER EXCEPTION
CREATE OR ALTER EXCEPTION will create the exception if it...
ALTER EXTERNAL FUNCTION
C. Valderrama
ALTER EXTERNAL FUNCTION has been implemented, to enable t...
COMMENT Statement Implemented
C. Valderrama
The COMMENT statement has been implemented for setting me...
Syntax Pattern
COMMENT ON DATABASE IS {'txt'|NULL};
COMMENT ON <basic_type> name IS {'txt'|NULL};
COMMENT ON COLUMN tblviewname.fieldname IS {'txt'|NULL};
COMMENT ON PARAMETER procname.parname IS {'txt'|NULL};
An empty literal string '' will act as NULL since the int...
<basic_type>:
DOMAIN
TABLE
VIEW
PROCEDURE
TRIGGER
EXTERNAL FUNCTION
FILTER
EXCEPTION
GENERATOR
SEQUENCE
INDEX
ROLE
CHARACTER SET
COLLATION
SECURITY CLASS1
1not implemented, because this type is hidden.
Extensions to CREATE VIEW Specification
D. Yemanov
FIRST/SKIP and ROWS syntaxes and PLAN and ORDER BY clause...
From Firebird 2.0 onward, views are treated as fully-feat...
Syntax
For syntax details, refer to Select Statement & Expressio...
RECREATE TRIGGER Statement Implemented
D. Yemanov
The DDL statement RECREATE TRIGGER statement is now avail...
Usage Enhancements
The following changes will affect usage or existing, pre-...
Creating Foreign Key Constraints No Longer Requires Exclu...
V. Horsun
Now it is possible to create foreign key constraints with...
Changed Logic for View Updates
Apply NOT NULL constraints to base tables only, ignoring ...
Declare BLOB Subtypes by Known Descriptive Identifiers
A. Peshkov, C. Valderrama
Previously, the only allowed syntax for declaring a blob ...
declare filter <name> input_type <number> output_type ...
entry_point <function_in_library> module_name <libra...
The alternative new syntax is:
declare filter <name> input_type <mnemonic> output_typ...
entry_point <function_in_library> module_name <libra...
where <mnemonic> refers to a subtype identifier known to ...
Initially they are binary, text and others mostly for int...
To get the predefined types, do
select RDB$TYPE, RDB$TYPE_NAME, RDB$SYSTEM_FLAG
from rdb$types
where rdb$field_name = 'RDB$FIELD_SUB_TYPE';
RDB$TYPE RDB$TYPE_NAME RDB$SYSTEM_FLAG
========= ============================ =================
0 BINARY 1
1 TEXT 1
2 BLR 1
3 ACL 1
4 RANGES 1
5 SUMMARY 1
6 FORMAT 1
7 TRANSACTION_DESCRIPTION 1
8 EXTERNAL_FILE_DESCRIPTION 1
Examples
Original declaration:
declare filter pesh input_type 0 output_type 3
entry_point 'f' module_name 'p';
Alternative declaration:
declare filter pesh input_type binary output_type acl
entry_point 'f' module_name 'p';
Declaring a name for a user defined blob subtype (remembe...
SQL> insert into rdb$types
CON> values('RDB$FIELD_SUB_TYPE', -100, 'XDR', 'test ty...
SQL> commit;
SQL> declare filter pesh2 input_type xdr output_type text
CON> entry_point 'p2' module_name 'p';
SQL> show filter pesh2;
BLOB Filter: PESH2
Input subtype: -100 Output subtype: 1
Filter library is p
Entry point is p2
ページ名:
新規
名前変更
ホーム
一覧
検索
最終更新
バックアップ
ヘルプ
最終更新のRSS