Ver Mensaje Individual
  #1  
Antiguo 13-04-2008
Avatar de xEsk
[xEsk] xEsk is offline
Miembro Premium
 
Registrado: feb 2006
Posts: 454
Reputación: 21
xEsk Va por buen camino
Una solución que se me ocurrió fue reemplazar la función rand() del Firebird por otra creada por mi (importarla en forma de UDF), pero después pensé, que es muy raro que lleve un random y no un randomize, así que mire manualmente en el fichero ib_udf2.sql que lleva el Firebird, y efectivamente, he encontrado el srand().

Te copio su descripción:
Código SQL [-]
/*****************************************
 *
 *  s r a n d
 *
 *****************************************
 *
 * Functional description:
 *  Seeds the random number generator using
 *  the current time and returns the first
 *  pseudo-random number (between 0 and 1)
 *  in the new sequence.
 *
 * Note:
 *  Two srand() calls performed within a second
 *  will return the same value.
 * 
 *****************************************/
DECLARE EXTERNAL FUNCTION srand 
  RETURNS DOUBLE PRECISION BY VALUE
  ENTRY_POINT 'IB_UDF_srand' MODULE_NAME 'ib_udf';

Saludos.
Responder Con Cita