|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Generate a Random value |
« View previous topic :: View next topic » |
Author |
Message
|
NikoP |
Posted: Thu Feb 12, 2004 7:02 am Post subject: Generate a Random value |
|
|
Novice
Joined: 08 Dec 2003 Posts: 16
|
Hi !
Does anyone know a way to generate a random value using ESQL ?
I didn't find a RANDOM() or RAND() function in the ESQL manual.
Thanks ! |
|
Back to top |
|
 |
mgk |
Posted: Thu Feb 12, 2004 7:25 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
It would help if we know the version of the product you are using. V 5 has a RAND function, earlier versions do not.
The syntax and help for RAND is:
Code: |
>>-RAND--(-+----------------------+-)-----------------------------><
'-IntegerExpression-' |
Quote: |
The RAND function returns a pseudo random number in the range 0.0 to 1.0. If supplied, the parameter initializes the pseudo random sequence.
The parameter can be of any numeric data type but any fractional part is ignored. The result is FLOAT unless the parameter is NULL, in which case the result is NULL. |
Cheers, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
NikoP |
Posted: Thu Feb 12, 2004 7:52 am Post subject: |
|
|
Novice
Joined: 08 Dec 2003 Posts: 16
|
mmm... I'm using WMQI 2.1 + CSD 4...
Is there another way ? |
|
Back to top |
|
 |
mgk |
Posted: Thu Feb 12, 2004 8:09 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Whilst it is not a random as such, UUIDASBLOB will create you a unique value if that helps. Failing that you could write your own plugin to call your favourite random function or hack a pusdo random function call in ESQL. Or you could call a DB stored procedure or PASSTHRU that called whatever Randomise function your DB supports...
Cheers, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|