ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Generate a Random value

Post new topic  Reply to topic
 Generate a Random value « View previous topic :: View next topic » 
Author Message
NikoP
PostPosted: Thu Feb 12, 2004 7:02 am    Post subject: Generate a Random value Reply with quote

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
View user's profile Send private message
mgk
PostPosted: Thu Feb 12, 2004 7:25 am    Post subject: Reply with quote

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
View user's profile Send private message
NikoP
PostPosted: Thu Feb 12, 2004 7:52 am    Post subject: Reply with quote

Novice

Joined: 08 Dec 2003
Posts: 16

mmm... I'm using WMQI 2.1 + CSD 4...
Is there another way ?
Back to top
View user's profile Send private message
mgk
PostPosted: Thu Feb 12, 2004 8:09 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Generate a Random value
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.