Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: NULL or empty string argument in procedure
morang3nf,
Here are some observations on your problem...
However, in your query you are referencing
optional fields as absolutes.
Therefore,.... if emailadd is null or gender is null,
then SEX=GENDER will return 'no data found'.
There are a number of ways to restructure the query...The simplest being, Only search using the Key fields which uniquely identify the row, in your case, perhaps Last_name and First_Name, etc. By definition, if a field is optional, then it wouldn't be needed to identify the row. Or, other examples:
Where xxxxx...
And ((field = optionalfield) or (optionalfield IS NULL))
And xxxx...
Or,
Where xxxx....
And Field = DECODE( optionalfield, NULL, Field, optionalfield)
(when the passed value is null, force a true condition
field=field else use the optionalfield: field = optionalfield)
Or, restructure the entire process:
a. Remove the ID assignment from the Person Trigger...
b. Rewrite code so you get the ID first, then do the
work.
Person_Key = GetPersonID(Last,First,Middle); ...etc. Insert into Person .... (last, first, person_key...etc); Insert into Landlord ...(person_key...etc);
4. When do you COMMIT the work?
Procedures and functions will not automatically COMMIT;
Either add COMMIT as last step, or, elsewhere in your
processing you have a COMMIT step...
Good Luck,
Robert Proffitt
RTProffitt AT beckman DOT com
Beckman Coulter
Brea California
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Thu Mar 23 2000 - 12:23:11 CST