Details
-
Technical task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
10.2.2-3, 10.2.2-1, 10.2.2-2, 10.2.2-4, 10.1.18
Description
The SQL standard syntax for NEXT VALUE FOR works for both non-qualified and qualified sequence names:
SET sql_mode=ORACLE; |
DROP SEQUENCE IF EXISTS s1; |
CREATE SEQUENCE s1; |
SELECT NEXT VALUE FOR s1; |
SELECT s1.nextval; |
+-------------------+
|
| NEXT VALUE FOR s1 |
|
+-------------------+
|
| 1 |
|
+-------------------+
|
+------------+
|
| s1.nextval |
|
+------------+
|
| 2 |
|
+------------+
|
SELECT NEXT VALUE FOR test.s1; |
+------------------------+
|
| NEXT VALUE FOR test.s1 |
|
+------------------------+
|
| 3 |
|
+------------------------+
|
Qualified sequence names also work with IBM DB2 syntax for PREVIOUS VALUE FOR
SELECT PREVIOUS VALUE FOR test.s1; |
+----------------------------+
|
| PREVIOUS VALUE FOR test.s1 |
|
+----------------------------+
|
| 3 |
|
+----------------------------+
|
Under terms of this task we'll add support for qualified sequence names for Oracle syntax, to make these queries work:
SELECT test.s1.nextval; |
SELECT test.s1.currval; |
Attachments
Issue Links
- relates to
-
MDEV-10139 Support for SEQUENCE objects
- Closed
-
MDEV-12883 CREATE SEQUENCE with huge MAXVALUE
- Closed