UUID functions: Read |
 |
F_UUIDVERSION |
function from adhoc |
Entrypoint
|
uuidversion |
|
Input |
CSTRING(250) |
valid UUID |
Output |
CSTRING(20) |
(variant and) version of
the UUID |
Possible variants are: (not yet implemented)
0 NCS (reserved for
backwards-compatibility)
10 the actuall variant as descriped in
the RFC4122
110
Microsoft (reserved for backwards-compatibility)
111
reserved for further variants
Possible versions are:
1
time-based
a. with a
real MAC-adress descriped in the IEEE 802-standard
b. with a
random-generated MAC-Adresse descriped in the IEEE 802-standard
2
DCE-security-version (with POSIX UIDs)
3
namespace-based (with MD5)
4 random
created
5
namespace-based (SHA-1)
The function returns:
V1a
V1b
V3
V4
V5
TestSQL (für TestISO.GDB)
SELECT ART, F_UUIDVERSION(UUID) FROM UUIDTEST ORDER BY UUIDTESTID;
SELECT NULL AS ISCORRECT, F_UUIDVERSION(NULL) FROM RDB$DATABASE; |
  |
F_UUID1TIMESTAMP |
function from adhoc
|
Entrypoint
|
uuid1timestamp |
|
Input |
CSTRING(250) |
valid UUID version 1 |
Output |
TIMESTAMP |
timestamp of the creating
date and time of the UUID version 1 |
Attention
In Windows this
function is not
"Thread-Safe": if more than one user call this function at the same time,
the result may be
wrong! Please check it by calling this function more times until we
change the code!
Reports
the timestamp from the UUID when the UUID was created. If the timestamp
isn’t real, the function reports 31.12.1899 00:00:00 (Time =
0 -
starttime of the internal InterBase/FireBird time) instead of FireBird
2.0, it returns <null> if it is declaired.
TestSQL (to use with TestISO.GDB)
If you take an compressed UUID for input instead of a normal UUID:
SELECT UUIDTESTID, F_UUIDVERSION(UUID), ART, NULL AS ISCORRECT,
F_UUID1TIMESTAMP(UUIDCOMPR) FROM UUIDTEST ORDER BY 1;
If you take a normal UUID for input (right):
SELECT UUIDTESTID, F_UUIDVERSION(UUID), ART, ZEITSTEMPEL AS ISCORRECT,
F_UUID1TIMESTAMP(UUID) FROM UUIDTEST ORDER BY 1;
SELECT NULL AS ISCORRECT, F_UUID1TIMESTAMP(NULL) FROM RDB$DATABASE;
|
  |
F_UUID1COMPRTIMESTAMP |
function from adhoc
|
Entrypoint
|
uuid1comprtimestamp |
|
Input |
CSTRING(250) |
valid compressed UUID
version 1 |
Output |
TIMESTAMP |
timestamp of the creating
date and time of the compressed UUID version 1 |
Attention
In Windows this
function is not
"Thread-Safe": if more than one user call this function at the same time,
the result may be
wrong! Please check it by calling this function more times until we
change the code!
Reports the timestamp from the UUID
when the UUID was created. If the
timestamp isn’t real, the function reports 31.12.1899
00:00:00 (Time =
0 - starttime of the internal InterBase/FireBird time) instead of
FireBird 2.0, it returns <null> if it is declaired.
TestSQL (to use with TestISO.GDB)
If you take a normal UUID for input instead of a compressed UUID:
SELECT UUIDTESTID, F_UUIDVERSION(UUID), ART, NULL AS ISCORRECT,
F_UUID1COMPRTIMESTAMP(UUID) FROM UUIDTEST ORDER BY 1;
If you take a compressed UUID for input (right):
SELECT UUIDTESTID, F_UUIDVERSION(UUID), ART, ZEITSTEMPEL AS
ISCORRECT,
F_UUID1COMPRTIMESTAMP(UUIDCOMPR) FROM UUIDTEST ORDER BY 1;
SELECT NULL AS ISCORRECT, F_UUID1COMPRTIMESTAMP(NULL) FROM RDB$DATABASE;
|
  |
F_UUID1MACMAC |
function from adhoc
|
Entrypoint
|
uuid1macmac |
|
Input |
CSTRING(250) |
valid UUID
Version 1a |
Output |
CSTRING(17) |
MAC-adress of the computer
where UUID was created |
TestSQL (to use with TestISO.GDB)
If you take a compressed UUID for input instead of a normal UUID:
SELECT UUIDTESTID, F_UUIDVERSION(UUID), ART, NULL AS ISCORRECT,
F_UUID1MACMAC(UUIDCOMPR) FROM UUIDTEST ORDER BY 1;
If you take a normal UUID for input (right):
SELECT UUIDTESTID, F_UUIDVERSION(UUID), ART, MACADRESS AS ISCORRECT,
F_UUID1MACMAC(UUID) FROM UUIDTEST ORDER BY 1;
SELECT NULL AS ISCORRECT, F_UUID1MACMAC(NULL) FROM RDB$DATABASE;
|
  |
F_UUID1MACCOMPRMAC |
function from adhoc
|
Entrypoint
|
uuid1maccomprmac |
|
Input |
CSTRING(250) |
valid compressed UUID
version 1a |
Output |
CSTRING(17) |
MAC-adress of the computer
where UUID was created |
TestSQL (to use with TestISO.GDB)
If you take a normal UUID for input instead of a compressed UUID:
SELECT UUIDTESTID, F_UUIDVERSION(UUID), ART, NULL AS ISCORRECT,
F_UUID1MACCOMPRMAC(UUID) FROM UUIDTEST ORDER BY 1;
If you take a compressed UUID for input (right):
SELECT UUIDTESTID, F_UUIDVERSION(UUID), ART, MACADRESS AS ISCORRECT,
F_UUID1MACCOMPRMAC(UUIDCOMPR) FROM UUIDTEST ORDER BY 1;
SELECT NULL AS ISCORRECT, F_UUID1MACCOMPRMAC(NULL) FROM RDB$DATABASE; |
     |