Re: [sqlite] random(*), randomblob(N), etc.

2007-08-15 Thread Shane Harrelson
Now thats a good idea! Thanks! On 8/15/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > "Shane Harrelson" <[EMAIL PROTECTED]> wrote: > > > > Other than the normal caveats for using customized versions of the > SQLite > > code, does this sound like it would work? > > > > Why not just write

Re: [sqlite] random(*), randomblob(N), etc.

2007-08-15 Thread drh
"Shane Harrelson" <[EMAIL PROTECTED]> wrote: > > Other than the normal caveats for using customized versions of the SQLite > code, does this sound like it would work? > Why not just write your own version of random() and register it using sqlite3_create_function()? -- D. Richard Hipp <[EMAIL

Re: [sqlite] random(*), randomblob(N), etc.

2007-08-15 Thread Shane Harrelson
Thanks for the response. I'm not sure either will work since my random table can be created at many different points in my application. I looked at the source, and I think that if I expose the state structure ( prng) in randomByte (remove static and move it outside of the function), I can save

Re: [sqlite] random(*), randomblob(N), etc.

2007-08-15 Thread drh
"Shane Harrelson" <[EMAIL PROTECTED]> wrote: > I have a table that has the rows sorted by using a column which is filled > with values from random(*). > > Is there a PRAGMA or other API which allows me to set the "seed" used by > random(*) such that > I can reproduce the same random sequence each

[sqlite] random(*), randomblob(N), etc.

2007-08-15 Thread Shane Harrelson
I have a table that has the rows sorted by using a column which is filled with values from random(*). Is there a PRAGMA or other API which allows me to set the "seed" used by random(*) such that I can reproduce the same random sequence each time? Thanks. -Shane