on 11-03-2011 4:02 PM
Hi,
Am I wrong or there is no random function in SQLScript? There is a series of math function, but random would quite useful especially when generating test data.
If it is not included now, will it be planned in next releases?
Regards,
Adam
Hello,
there is no such function mentioned anywhere in SQL reference guide (at the moment) - so I guess it is not available... but you can implement yourself - technically random function does not exist - it is always complex function seeded by current time (where current time is making it "random")
You can find more information here:
http://en.wikipedia.org/wiki/Random_number_generation
Alternative is to way few days - maybe it will be available when SP03 will be out.
Tomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This message was moderated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would really look forward to having a good random generator built in HANA. Finally I have created a very pseudo random generator, but it fits my needs. Code is like this:
number := mod((8253729 * EXTRACT(SECOND from NOW()) * EXTRACT(MINUTE from NOW()) + random_seq.nextval), 100);
where random_seq is just a sequence starting at 1, no cycles. Produces sort of random integer numbers less then 100. Also sequence is not entered directly.
Thanks for input.
Edited by: Adam Podraza on Nov 4, 2011 3:51 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.