On Fri, Feb 06, 2009 at 03:36:12PM -0500, Jim Starkey wrote:
> Eric Bergen wrote:
>> Can the syntax problem be solved or at least partially solved by
>> supporting expressions as default values? By using expressions you
>> could provide a simple incrementing function call that would return
>> the next value. You could also provide several different functions or
>> arguments for things like auto_increment_increment (even though I
>> don't like that). I think this is sort of what Robert is describing.
>>   
>
> That is a very elegant solution (also one that Interbase implemented in  
> 1985).

The table proto lays the groundwork for this (being able to store an
expression). Then it's just up to some crazy person to go and put it in
the rest of the code.

But soon, we too, will be able to join 1985.

> What it doesn't do, however, is provide the MySQL functionality where  
> setting an explicit auto-increment value field automatically move up the  
> auto-increment variable.  Using a initializing expression to increment a  
> sequence doesn't guarantee a unique key; the MySQL auto-increment does.
>
> On balance, I would favor a default value expression over auto-magic ESP.

Would this be do-able in a CHECK expression? simply check that the value
being inserted is equal to or greater than the next id in the sequence?
-- 
Stewart Smith

_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help   : https://help.launchpad.net/ListHelp

Reply via email to