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 -> Problem with TOO_MANY_ROWS

Problem with TOO_MANY_ROWS

From: Janet Wroby <jwroby_at_morpace.com>
Date: Mon, 3 Jan 2000 14:24:35 -0500
Message-ID: <946908674.127987@axilla.wwnet.net>


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;

    END get_timesheet_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

Original text of this message

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