Subject | Re: [firebird-support] Bad design causing problems |
---|---|
Author | Ann W. Harrison |
Post date | 2006-05-24T18:22:12Z |
Rik Barker wrote:
duplicate names. There are always going to be people with
the bad taste to share names. That said, there's nothing
wrong with a selectable stored procedure (other than
portability) and your procedure is easy to fix.
Change this line:
SELECT MAX(ID) FROM ARTISTS WHERE (Artists.Name = :NAME) INTO :FoundID;
That will get rid of the "multiple rows in a singleton select" error.
Cheers,
Ann
>As everyone has said, you're going to have problems with
> I've got a problem inserting records ...
>
> Several of the tables need to only insert if the record isn't already
> there....
duplicate names. There are always going to be people with
the bad taste to share names. That said, there's nothing
wrong with a selectable stored procedure (other than
portability) and your procedure is easy to fix.
Change this line:
> SELECT ID FROM ARTISTS WHERE (Artists.Name = :NAME) INTO :FoundID;To this:
SELECT MAX(ID) FROM ARTISTS WHERE (Artists.Name = :NAME) INTO :FoundID;
That will get rid of the "multiple rows in a singleton select" error.
Cheers,
Ann