Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: testing an overloaded function

Re: testing an overloaded function

From: DStevens <dstevens_at_navidec.com>
Date: Thu, 06 Dec 2001 17:00:04 -0700
Message-ID: <3C100684.C8E66DE4@navidec.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US