如何利用4gl生成随机唯一标识(UUID)?

之前分享过利用Oracle数据库自带功能生成随机全局唯一识别符,这次介绍利用4gl生成

security.RandomGenerator.CreateUUIDString
Creates a new universal unique identifier (UUID).

Syntax
security.RandomGenerator.CreateUUIDString()
  RETURNS STRING
Usage
This method generates an universal unique identifier and returns the value as STRING.

The generated string follows the UUID version 4 specification. Version 4 UUIDs have the form xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx where x is any hexadecimal digit and y is one of 8, 9, A, or B.


上述摘自4js官方文档。
进入xshell界面

vim 新建一个4gl文档

vim test1.4gl 

IMPORT security


 MAIN

DEFINE l_test1                  BIGINT




CALL security.RandomGenerator.CreateRandomNumber() RETURNING l_test1

DISPLAY l_test1

END MAIN

执行r.cs 编译

执行程序
fglrun test1
即可看到已经利用4gl自动产生UUID

posted @ 2020-10-23 10:26  品客Blogs  阅读(98)  评论(0编辑  收藏