SHOW CREATE SEQUENCE
You are viewing an old version of this article. View
the current version here.
MariaDB starting with 10.3.1
SEQUENCEs are being introduced in MariaDB 10.3.
Syntax
SHOW CREATE SEQUENCE sequence_name;
Description
Shows the CREATE SEQUENCE statement that created the given sequence. The statement requires the SELECT privilege for the table.
Example
create sequence s1 start with 50; show create sequence s1\G; *************************** 1. row *************************** Table: t1 Create Table: CREATE SEQUENCE `s1` start with 50 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=Aria
Notes
If you want to see the underlying table structure used for the SEQUENCE
you can use SHOW CREATE TABLE on the SEQUENCE
. You can also use SELECT
to read the current recorded state of the SEQUENCE
:
MariaDB [test]> create sequence t1; MariaDB [test]> show create table s1\G *************************** 1. row *************************** Table: s1 Create Table: CREATE TABLE `s1` ( `next_value` bigint(21) NOT NULL COMMENT 'next not cached value', `min_value` bigint(21) NOT NULL COMMENT 'min value', `max_value` bigint(21) NOT NULL COMMENT 'max value', `start` bigint(21) NOT NULL COMMENT 'start value', `increment` bigint(21) NOT NULL COMMENT 'increment value', `cache` bigint(21) NOT NULL COMMENT 'cache size', `cycle` tinyint(1) unsigned NOT NULL COMMENT 'cycle state', `round` bigint(21) NOT NULL COMMENT 'How many cycles has been done' ) ENGINE=Aria SEQUENCE=1 MariaDB [test]> select * from s1; +------------+-----------+---------------------+-------+-----------+-------+-------+-------+ | next_value | min_value | max_value | start | increment | cache | cycle | round | +------------+-----------+---------------------+-------+-----------+-------+-------+-------+ | 1 | 1 | 9223372036854775806 | 1 | 1 | 1000 | 0 | 0 | +------------+-----------+---------------------+-------+-----------+-------+-------+-------+
See also
Comments
Comments loading...
Content reproduced on this site is the property of its respective owners,
and this content is not reviewed in advance by MariaDB. The views, information and opinions
expressed by this content do not necessarily represent those of MariaDB or any other party.