Sunday, November 18, 2007

Re: [firebird-support] GUID/Random number generation?

randallsell wrote:
> Hi,
>
> I have a requirement to create a unique 7 character string (numbers
> and letters). In the file-based implementation, we simply extracted
> the first 7 characters of a GUID. But I see no way to obtain a GUID in
> PSQL. Surely there is a RANDOM function? But didn't find a reference
> to such a beast in Helen's Bible.
>
> BTW- I can't used a Generator because these values are not internal.
>
> So, is there a free library I can obtain to either generate a GUID or
> a random value?

Well, certainly the first 7 characters of a GUID are not going to be
unique, either!!

When you say the value are not "internal" do you mean that some of the
values are generated in the database, and so are generated outside the
database?

That would be fairly easy to solve with a generator, though: simply
generate odd numbers inside the database, and even numbers outside the
database. You can do that with the generator by using an "increment" of 2.

Dean.

__._,_.___
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Resources item
on the main (top) menu.  Try Knowledgebase and FAQ links !

Also search the knowledgebases at http://www.ibphoenix.com

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Recent Activity
Visit Your Group
Sitebuilder

Build a web site

quickly & easily

with Sitebuilder.

New business?

Get new customers.

List your web site

in Yahoo! Search.

Yahoo! Groups

Endurance Zone

A Yahoo! Group

for better endurance.

.

__,_._,___

No comments: