Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread RandomRange as Default value
Fri, Sep 22 2006 5:27 AMPermanent Link

Mike Mayer
Hi,

I want to specify default value for one ID field in such format from 1000000 to 9999999.
In delphi I could use RandomRange(1000000, 9999999), what operator I should use in DBISAM?
Does RAND support numbers range?

Regards,
Mike
Fri, Sep 22 2006 10:27 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Mike


Using a random number for the ID field sounds like a BAD idea - its always possible to get duplication - why not use a simple AUTOINC?

Roy Lambert
Fri, Sep 22 2006 2:50 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Mike,

<< I want to specify default value for one ID field in such format from
1000000 to 9999999. In delphi I could use RandomRange(1000000, 9999999),
what operator I should use in DBISAM? Does RAND support numbers range? >>

Unfortunately, DBISAM does not allow any expressions in default values for
fields except for simple constant values or CURRENT_DATE, CURRENT_TIME,
CURRENT_TIMESTAMP, or CURRENT_GUID calls.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image