If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Generate Alphanumeric random numbers

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-11-04, 16:15
ranjss ranjss is offline
Registered User
 
Join Date: Aug 2004
Posts: 1
Generate Alphanumeric random numbers

Hi,

Can you please let me know a simple way to generate random alphanumeric random numbers

Alternatively I found something as given below on net.. can anyone throw light on whether the following will work ?

get a random numeric number... change the number into EBCDIC format ??

what is the function to convert a normal numeral to a three digit EBCDIC format ?

Response will be greatly appreciated.

Regards
Reply With Quote
  #2 (permalink)  
Old 08-11-04, 16:52
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
with temp(a) as
(
values(1)
union all
select INT(RAND()*255) from temp where
a not between 65 and 90
and a not between 97 and 122
and a not between 48 and 57
)
select chr(a) from temp where
a between 65 and 90 -- A-Z A
or a between 97 and 122 -- a-z

or a between 48 and 57 -- 0 - 9
;

HTH

Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On