नोट
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप साइन इन करने या निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
Applies to:
Databricks SQL
Databricks Runtime 16.1 and above
Returns a random string of length alpha-numeric characters.
Syntax
randstr ( length [, seed] )
Arguments
length: ASMALLINTorINTconstant non-negative expression, specifying the length of the result string.seed: An optionalSMALLINT, orINTexpression serving as a seed for the random string generation.
Returns
An STRING consisting of the characters a-z, A-Z, and 0-9.
Examples
> SELECT randstr(10), randstr(10);
Xn2IiSepLX w3F34omh1C
-- Using a fixed seed, the outcome is deterministic series of random strings.
> SELECT randstr(10, 0), randstr(10, 0) FROM VALUES(1), (2), (3);;
ceV0PXaR2I ceV0PXaR2I
lBhHi56d0u lBhHi56d0u
CtuwSOTLiL CtuwSOTLiL