| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> Problem with TOO_MANY_ROWS
hello-
I am new to working with Oracle and do not understand why I am getting the TOO_MANY_ROWS error in a Function I've created.
The table time_daily has the 2 fields: time_daily.TSLine_id and time_daily.day_nr as a composite primary key - there is only at most one row that should match a set of values passed in.
My function is:
CREATE or REPLACE FUNCTION get_timesheet_comment
(line_id IN NUMBER,
day_nr IN NUMBER) RETURN VARCHAR2 IS
ts_comment VARCHAR2(200);
BEGIN
SELECT desc_tx INTO ts_comment
FROM time_daily
WHERE ((time_daily.TSLine_id = line_id)
AND (time_daily.day_nr = day_nr));
RETURN ts_comment;
EXCEPTION
WHEN TOO_MANY_ROWS then
ts_comment := 'too many rows';
RETURN ts_comment;
But when I try to call the function - I get the message "too many rows"
ex:
SELECT get_timesheet_comment(847802, 3) FROM dual;
Any help would be much appreciated.
Thanks,
Janet
Received on Mon Jan 03 2000 - 13:24:35 CST
![]() |
![]() |