Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> HELP: Checking pre-existence of a row with certain attributes
Hi All,
I'd be grateful if anyone could give me a pointer to a solution to the following:
I need to determine whether a table has a row in it which is incomplete (ie. has one field filled, but another unfilled) from within a procedure, which then has to act upon the outcome of this test and, if there isn't one already there, create such a row.
I can do it with
select count(id) where date is null and then process on from there, but I'm looking for something which might reduce the amount of SQL I need a la
IF (select into vvar id from schema.table where ...) THEN
...
ELSE
...
END IF
I thought 'exists' might be the solution, but one or other of the two states (either I need a new row or not) returns 0 rows, and thus fails...
Any potential avenues for exploration gratefully received! (Both the Oracle manuals and the O'Reilly books seem to rather skip over this...)
Thanks in Advance!
Matthew Darlison
Webmaster
UCL Safety Office
PS: Please copy any responses by email - my news server expires things *very* quickly! Received on Thu Jan 23 1997 - 00:00:00 CST
![]() |
![]() |