Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Generate functions containing uppercase and lowercase characters and numbers in oracle

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Function createString (n_num in number) return varchar2 is

I integer default 0

V_token varchar2 (50) default''

Begin

While i

< n_num loop if mod(round(dbms_random.value(1, 2)), 2) >

0 then

-- generate characters

If (mod (round (dbms_random.value (1,2)), 2) > 0) then

-- generate uppercase characters

V_token: = concat (v_token

Chr (65 + floor (dbms_random.value (0,26)

Else

-- generate lowercase characters

V_token: = concat (v_token

Chr (97 + floor (dbms_random.value (0,26)

End if

Else

-- generate numbers

V_token: = concat (floor (dbms_random.value (0,10)

End if

I: = I + 1

End loop

Return v_token

End

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report