Subject Re: [firebird-support] Design Question: Storing and using generic text "tags"
Author Daniel Albuschat
2009/6/26 Jarrod Hollingworth <jarrod@...>:
>
> Hi Daniel,
>
>> I'd imagine a design like this:
>
> Thank you for your input on this.
>
>> create table tags
>> (
>> constraint un_tags_name unique(name)
>
> In a multi-user environment I'll have to be prepared for this to fail (two
> users added the same new tag at the same time).

How are you going to face this problem? I think the error will only
surface when the transaction is committed.
Handle the error and re-try?

>> create procedure find_tag(name varchar(255)) returns (id_tag
>> integer) as
>> begin
>> select id from tags where name=upper(:name) into :id_tag;
>> if (:id_tag is not null) then
>
> I think you meant "if (:id_tag is null) then".

Oops, yeah ;-)

Daniel

--
eat(this); // delicious suicide