how to write a function to retrieve random character from A TO Z
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.

««12

how to write a function to retrieve random... Expand / Collapse
Author
Message
Posted 8/22/2008 9:21:13 AM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 8/22/2008 11:30:56 AM
Posts: 22, Visits: 41


oh ... then you are right ....
am working on V2R5.
OK, thanks for ur reference.

Thanks


Dileep
Post #12696
Posted 8/22/2008 6:05:38 PM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: Today @ 5:02:02 PM
Posts: 225, Visits: 531
Try this:

SELECT
CASE WHEN Rand = 1 THEN 'A'
WHEN Rand = 2 THEN 'B'
WHEN Rand = 3 THEN 'C'
WHEN Rand = 4 THEN 'D'
WHEN Rand = 5 THEN 'E'
WHEN Rand = 6 THEN 'F'
WHEN Rand = 7 THEN 'G'
WHEN Rand = 8 THEN 'H'
WHEN Rand = 9 THEN 'I'
WHEN Rand = 10 THEN 'J'
WHEN Rand = 11 THEN 'K'
WHEN Rand = 12 THEN 'L'
WHEN Rand = 13 THEN 'M'
WHEN Rand = 14 THEN 'N'
WHEN Rand = 15 THEN 'O'
WHEN Rand = 16 THEN 'P'
WHEN Rand = 17 THEN 'Q'
WHEN Rand = 18 THEN 'R'
WHEN Rand = 19 THEN 'S'
WHEN Rand = 20 THEN 'T'
WHEN Rand = 21 THEN 'U'
WHEN Rand = 22 THEN 'V'
WHEN Rand = 23 THEN 'W'
WHEN Rand = 24 THEN 'X'
WHEN Rand = 25 THEN 'Y'
WHEN Rand = 26 THEN 'Z'
END AS RandChar
FROM
(
SELECT
RANDOM(1, 26) AS Rand
) QueryAlias1 ;
Post #12706
Posted 8/25/2008 5:47:04 PM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 8/25/2008 5:46:43 PM
Posts: 23, Visits: 73
I tried this query and it just worked fine to me.

Ivy
Post #12726
« Prev Topic | Next Topic »

««12

Reading This Topic Expand / Collapse
Active Users: 0 ( 0 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 5:27pm

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.063. 8 queries. Compression Disabled.