Cail,
On Aug 20, 2008, at 3:47 PM, Cail Borrell wrote:
If you change the internal data type of your unique attribute to String
That would be kind of problem, for I am working with a legacy database which already contains lots of rows.
Not that it would be entirely out of question, but it would complicate things considerably :(
you should be able to use a little sql injection when inserting your record.
Sorry, I got lost here. You mean I should catch the generated SQL in EOF just before sent to the database, and replace the value which is sent to the column by the "coalesce(...)+1" _expression_?
Just set the value of your unique column to something like:
coalesce (select max(<unique column>) from <table name>, cast (1000000 as <unique column data type>)) + 1
and invalidate the eo after insertion.
If not, colour me please dumb and elucidate.
If so... well, I haven't considered this possibility -- good point!
Perhaps I could do the same with an integer column and simpler _expression_
(select max(<unique column>) from (<table name>))+1
could I not? (Assumed there is at least one non-nil column, which it happens to be there all right -- otherwise I could use the improvements Florijan or Francis suggested.)
In the latest versions of FrontBase triggers are enabled by default.
Good, didn't know that. Thanks!
---
Ondra Čada
OCSoftware:
email@hidden http://www.ocs.czprivate
email@hidden http://www.ocs.cz/oc