PL/SQL (MOSC)

MOSC Banner

ORA-01422: exact fetch returns more than requested number of rows

edited Feb 17, 2016 12:11AM in PL/SQL (MOSC) 3 commentsAnswered ✓

CREATE OR REPLACE PROCEDURE TP_TID_GID (tid in number) AS
V_PARAM_GROUP_ID NUMBER(20);
V_PARENT_PARAM_GROUP_ID NUMBER(20);
EXEC_TXT VARCHAR2(2000);
   CURSOR C1
   IS
    select distinct param_group_id from TEST_PARAMETER_GROUP WHERE test_instance_id=tid;
BEGIN
   FOR C1REC IN C1   
   LOOP
   EXEC_TXT := 'SELECT PARAM_GROUP_ID, PARENT_PARAM_GROUP_ID FROM (SELECT * FROM TEST_PARAMETER_GROUP START WITH PARENT_PARAM_GROUP_ID=' || C1REC.param_group_id || ' CONNECT BY PRIOR PARAM_GROUP_ID=PARENT_PARAM_GROUP_ID ORDER BY PARENT_PARAM_GROUP_ID ASC) VT_PCT WHERE test_instance_id=' || tid;

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center