Hi, Appreciate all your help!!
Initially I tried with CAST(CHAR (RAND() * 1000000000 AS CHAR)) and also tried with different CAST and RIGHT functions. It gave me -433 and -413 SQL errors. As you mentioned, I just moved AS CHAR(9) outside and its working perfect. Here is the SQL which worked in my DB2 V 7.2...
SET Random_Num = CAST ( INT ( RAND () * 1000000000) AS CHAR(9))
Thanks again. Have a good one!!
Hi Sathyaram, please don't take me wrong. I just wanted to see different ideas from the forum. That's why I didn't put my SQL. Even I was not in hurry. If I give my SQL, will just get the correction to it. I won't get different ideas. Appreciate all your hardwork in this forum. Have a good one!!