Oracle和MySQL分别生成sequence序列
Jun 07, 2016 pm 04:49 PM有时候在往数据库中插入数据的时候,如果ID值是32位的UUID, 而自己随便写个字符又不合适,这时就要用到函数来产生一个序列值 Or
有时候在往数据库中插入数据的时候,如果ID值是32位的UUID,
而自己随便写个字符又不合适,这时就要用到函数来产生一个序列值
Oracle:
select sys_guid() from dual;
MySQL:
SELECT REPLACE(UUID(),'-','') FROM DUAL;
因为mysql的UUID()生成的序列中间有'-'需要进行替换一下。
以下内容你也可能喜欢:
ORA-01002: fetch out of sequence
判断Oracle sequence是否存在
Oracle 中的sequence用法
Oracle利用触发器和sequence实现主键自增长
Oracle中sequence使用的限制
Oracle创建自增字段sequence
本文永久更新链接地址:

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Reduce the use of MySQL memory in Docker

How do you alter a table in MySQL using the ALTER TABLE statement?

How to solve the problem of mysql cannot open shared library

What is SQLite? Comprehensive overview

Run MySQl in Linux (with/without podman container with phpmyadmin)

Running multiple MySQL versions on MacOS: A step-by-step guide

What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)?

How do I configure SSL/TLS encryption for MySQL connections?
