Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: testing an overloaded function
I wouldn't do a count(*) at all.
Instead, I would:
1) Put a unique index on first name, last name to prevent duplicates
or
2) Pick the FIRST row returned
or
3) Present the user with a list of customers, letting them chose one, then read
by id.
But -- your original question was what is the best way to return a null when
multiples. Maybe this ...
Select max(customer_id), min(customer_id) into maxid, minid from customer where
....
If (maxid != minid) then
return(NULL);
else
return(minid)
end if;
bullseye wrote:
> My fault for leaving out critical detail. Both functions end up calling a
> third function that uses the customer id to give a result....When
> first_name = 'A' and last_name = 'B' are used to come up with the id, two
> customer id's can show up if 'A' and 'B' are two different customers with
> the same name.
>
> Which customer id does the third function use to generate the result?
> wouldn't this cause a problem?...
>
>
Received on Thu Dec 06 2001 - 18:00:04 CST