| 1 |
--------------------- |
| 2 |
Native SQL data types |
| 3 |
--------------------- |
| 4 |
|
| 5 |
|
| 6 |
BIGINT (FB 1.5) |
| 7 |
-------------- |
| 8 |
|
| 9 |
Function: |
| 10 |
SQL99-compliant exact numeric type. |
| 11 |
|
| 12 |
Author: |
| 13 |
Dmitry Yemanov <[email protected]> |
| 14 |
|
| 15 |
Syntax rules: |
| 16 |
BIGINT |
| 17 |
|
| 18 |
Storage: |
| 19 |
64-bit, signed |
| 20 |
|
| 21 |
Example(s): |
| 22 |
1. DECLARE VARIABLE VAR1 BIGINT; |
| 23 |
2. CREATE TABLE TABLE1 (FIELD1 BIGINT); |
| 24 |
|
| 25 |
Note(s): |
| 26 |
1. Available in Dialect 3 only. |
| 27 |
2. Quote from the SQL-99 specification: |
| 28 |
|
| 29 |
SMALLINT, INTEGER, and BIGINT specify the data type exact numeric, |
| 30 |
with scale of 0 (zero) and binary or decimal precision. The choice |
| 31 |
of binary versus decimal precision is implementation-defined, but |
| 32 |
the same radix shall be chosen for all three data types. The precision |
| 33 |
of SMALLINT shall be less than or equal to the precision of INTEGER, |
| 34 |
and the precision of BIGINT shall be greater than or equal to the |
| 35 |
precision of INTEGER. |
| 36 |
|
| 37 |
|
| 38 |
BOOLEAN (FB 3.0) |
| 39 |
-------------- |
| 40 |
|
| 41 |
Function: |
| 42 |
SQL2008-compliant boolean type. |
| 43 |
|
| 44 |
Author: |
| 45 |
Adriano dos Santos Fernandes <adrianosf at gmail.com> |
| 46 |
|
| 47 |
Syntax rules: |
| 48 |
BOOLEAN |
| 49 |
|
| 50 |
Storage: |
| 51 |
8-bit |
| 52 |
|
| 53 |
Example(s): |
| 54 |
1. DECLARE VARIABLE VAR1 BOOLEAN = TRUE; |
| 55 |
2. CREATE TABLE TABLE1 (FIELD1 BOOLEAN); |
| 56 |
|
| 57 |
Note(s): |
| 58 |
1. Quote from the SQL-2008 specification: |
| 59 |
|
| 60 |
The data type boolean comprises the distinct truth values TRUE and FALSE. Unless prohibited |
| 61 |
by a NOT NULL constraint, the boolean data type also supports the truth value UNKNOWN as the |
| 62 |
null value. This specification does not make a distinction between the null value of the |
| 63 |
boolean data type and the truth value Unknown that is the result of an SQL <predicate>, |
| 64 |
<search condition>, or <boolean value expression>; they may be used interchangeably to mean |
| 65 |
exactly the same thing. |
| 66 |
|
| 67 |
2. Represented in the API with the FB_BOOLEAN type and FB_TRUE and FB_FALSE constants. |
| 68 |
|
| 69 |
3. The value TRUE is greater than the value FALSE. |
| 70 |
|
| 71 |
4. Non-booleans values are not implicitly convertible to boolean in boolean-specific expressions |
| 72 |
like predicates and arguments for operators NOT, AND, OR and IS. |
| 73 |
|
| 74 |
5. It's allowed to test booleans without compare with TRUE or FALSE. For example, |
| 75 |
"field1 OR field2" and "NOT field1" are valid expressions. It's also allowed to compare with |
| 76 |
others operators, including the new IS operator: "field1 IS FALSE". |