Oracle database — Primary key ID Generating non repeating string functions sys_guid()

Prepare the pressure test server today , Ready to build 10W Data , But the primary key ID want Oracle Automatic database generation .

stay oracle8i A function for generating non duplicate data is provided later sys_guid() altogether 32 position , The main basis of generation is time and machine code , Unique in the world , be similar to java Medium UUID( They are the only ones in the world ).

Its application scenarios : When a field in the database is set to be unique , It can be generated automatically ( For example, the primary key );

Access method select sys_guid() from dual ;

Examples :
INSERT INTO “YG_IS”.“VIP_ACTUALSTORAGE_DETAIL” (“ID”, “STORAGENO”, “BARCODE”,
“PONO”, “AMOUNT”, “ACTUALAMOUNT”, “RETURNAMOUNT”, “DIFFERAMOUNT”, “CREATETIME”)
VALUES (sys_guid(), ‘2017031009-088’, ‘AF2U1345DU1AQ6230’, ‘2100118353’, ‘1’,
‘1’, ‘0’, ‘0’, TO_DATE(‘2017-03-14 16:45:27’, ‘SYYYY-MM-DD HH24:MI:SS’));

effect :

Technology
©2020 ioDraw All rights reserved
Vue The difference between single page and multi page 0.96OLED display -4 Line SPI explain R In language Axis() Detailed explanation of function parameters JAVA Snake games ( Source code + notes )C++ vector Simulation Implementation of class javascript Adding and deleting form information CCF A series of questions --2016 year 4 Month 1 Calculation of break point postman Interface test get timestamp and MD5 encryption 【 Recommended benefits 】c++ use easyx Making pixel birds , Simple hands on games TCP/IP There are so many loopholes in the agreement ?