On Feb 8, 2010, at 3:45 PM, Nate Lowrie wrote:
> I have a field in a database table that is a unique non-primary key
> field. I would like to check for uniqueness in the bizobj
> validateRecord method. I know that I can do it with a call to a temp
> cursor executing a stored procedure, but I wanted to know if there was a
> faster way. The other option is to have it fail on the save method, but
> then I have to have it separate from the other validation checks and
> need to parse the error to make sure it's a unique key error on that field.
The bizobj will only usually have a small subset of all the records in
the table, so it's going to end up having to make a database call anyway.
Unless there was a good reason to do otherwise, I'd catch the
DBQueryException and handle that. In a multi-user scenario, you'd end up having
to do that anyway.
-- Ed Leafe
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message:
http://leafe.com/archives/byMID/[email protected]