当前位置:网站首页>Kingbasees plug-in DBMS of Jincang database_ RANDOM
Kingbasees plug-in DBMS of Jincang database_ RANDOM
2022-06-25 11:07:00 【Thousands of sails pass by the side of the sunken boat_】
Catalog
1. DBMS_RANDOM
1.1. DBMS_RANDOM Introduce
KingbaseES Provides DBMS_RANDOM Random data generation function defined under the system package .DBMS_RANDOM The system package provides a random number or character generator .
You need to create extension dbms_random, When you don't need to drop extension dbms_random that will do .
The following table lists them DBMS_RANDOM System packages and a brief description of them .
surface 1 DBMS_RANDOM Package subroutines and functions
Subroutines / function | describe |
INITIALIZE | Use a seed value to initialize the package |
NORMAL Function | Produce a standard normal distribution function |
RANDOM Function | Generate a random integer |
SEED Procedure | Reset random number seed |
STRING Function | Generate a random string |
TERMINATE Procedure | Provides syntactic compatibility without performing any operations |
VALUE Function | Generates a random number in a specified range |
2. INITIALIZE Procedure
Use a seed value to initialize DBMS_RANDOM package , By default ,DBMS_RANDOM The package is based on the user 、 Time 、 Session to initialize .Initialize This function is obsolete , Although currently supported , However, this initialization method is reserved for historical reasons and compatibility .
Grammar format :
DBMS_RANDOM.INITIALIZE(init INTEGER);
Parameter description :
surface 2 initialize Parameters
Parameters describe init Random number seed value
Return value description :
VOID
Example :
CALL dbms_random.initialize(8);
3. NORMAL Function
Produce a standard normal distribution function , The standard deviation of this normal distribution is 1, The expected value is 0.
Grammar format :
DBMS_RANDOM.NORMAL();
Parameter description :
No arguments
Return value description :DOUBLE
Example :
SELECT dbms_random.normal();
4. RANDOM Function
Generate a random integer , This function is out of date , Although it still supports , But it should not be used , Keep this function for compatibility .
Grammar format :
DBMS_RANDOM.RANDOM();
Parameter description :
No arguments
Return value description :
NTEGER
Example :
CALL dbms_random.random();
5. SEED Procedure
Reset seed , Be similar to initialize function ,initialize Functions have been eliminated . seed Function supports both numeric and character values as seed values , and initialize Only numerical values are supported .
Grammar format :
DBMS_RANDOM.SEED(i INTEGER);
DBMS_RANDOM.SEED(t TEXT);
Parameter description :
surface 3 seed Parameters
Parameters describe i Random number seed value t Random number symbol seed value
Return value description :
surface 4 seed Return value
function type SEED(i INTEGER) VOID SEED(t TEXT) VOID
Example :
CALL dbms_random.seed(8);
CALL dbms_random.seed('test');
6. STRING Function
Get a random string , The first parameter is the format of the string , The second parameter is the length of the string . Maximum length 5000, If the parameter exceeds 5000 Will automatically use 5000 Handle .
Grammar format :
DBMS_RANDOM.STRING(type TEXT,len INTEGER);
Parameter description :
surface 5 string Parameters
surface 6 type The corresponding meaning of the parameter
Parameters describe type The type of string generated len The length of the resulting string
'x','X' | Returns a string of uppercase letters and numbers |
'p','P' | Returns a string of any printable character |
Return value description :
TEXT
Example :
SELECT dbms_random.string('U',5);
SELECT dbms_random.string('P',2);
SELECT dbms_random.string('x',4);
SELECT dbms_random.string('a',2);
SELECT dbms_random.string('l',3);
7. TERMINATE Procedure
The original function is to finish using dbms_random Execute this function when package , But now this function does nothing , Reserved for syntax compatibility .
Grammar format :
DBMS_RANDOM.TERMINATE();
Parameter description :
No arguments
Return value description :
VOID
Example :
CALL dbms_random.terminate();
8. VALUE Function
The first way to use no parameters is to get a value greater than or equal to 0 And less than 1 The random number , Accuracy of 16 Decimal place .
In the second way, you can specify the minimum and maximum values , The range of the return value is greater than or equal to low, Less than high, The accuracy is the same as 16 Decimal place .
Grammar format :
DBMS_RANDOM.VALUE();
DBMS_RANDOM.VALUE(low INTEGER,high INTEGER);
Parameter description :
surface 7 value Parameters
Parameters describe low The minimum value of the generated random number high The maximum value of the generated random number
Return value description :
surface 8 value Return value
function type VALUE() VOID VALUE(low INTEGER,high INTEGER) VOID
Example :
SELECT dbms_random.value();
SELECT dbms_random.value(10,15);
边栏推荐
- 一个五年北漂的技术er,根据这些年的真实经历,给应届生的一些建议
- CDN+COS搭建图床超详细步骤
- 开源社邀请您参加OpenSSF开源安全线上研讨会
- Apache ShenYu 入门
- 16 种企业架构策略
- Handler asynchronous message processing
- [image fusion] image fusion based on morphological analysis and sparse representation with matlab code
- 金仓数据库 KingbaseES 插件DBMS_OUTPUT
- XSS攻击
- Dell technology performs the "fast" formula and plays ci/cd
猜你喜欢

SystemVerilog(十三)-枚举数据类型

Coscon'22 lecturer solicitation order

Task03 probability theory

【文件包含漏洞-04】经典面试题:已知某网站仅存在本地文件包含漏洞时,如何GetShell?

XSS攻击

Software testing to avoid being dismissed during the probation period

Handler asynchronous message processing

Detailed explanation of Android interview notes handler

一个五年北漂的技术er,根据这些年的真实经历,给应届生的一些建议

Apache ShenYu 入門
随机推荐
CDN+COS搭建图床超详细步骤
Technical practice and development trend of video conference all in one machine
Handler asynchronous message processing
Socket communication principle
服务端渲染
Remove the problem of orange border on the desktop control in WebView
XSS attack
金仓数据库 KingbaseES 插件force_view
Simple use of SVN
性能之文件系统篇
Coscon'22 lecturer solicitation order
Advanced single chip microcomputer -- development of PCB (2)
金仓数据库 KingbaseES 插件identity_pwdexp
学会自学【学会学习本身,比学什么都重要】
After reading this article, I will teach you to play with the penetration test target vulnhub - drivetingblues-7
OODA working method
Is it safe for Guosen Securities to open a securities account
How to start the phpstudy server
Application of global route guard
从GEE中免费获取全球人类住区层 (GHSL) 数据集