Subject | Re: [firebird-support] Design Question: Storing and using generic text "tags" |
---|---|
Author | Daniel Albuschat |
Post date | 2009-06-26T13:22:27Z |
2009/6/26 Jarrod Hollingworth <jarrod@...>:
surface when the transaction is committed.
Handle the error and re-try?
Daniel
--
eat(this); // delicious suicide
>How are you going to face this problem? I think the error will only
> 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).
surface when the transaction is committed.
Handle the error and re-try?
>> create procedure find_tag(name varchar(255)) returns (id_tagOops, yeah ;-)
>> 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".
Daniel
--
eat(this); // delicious suicide