Execution of stored procedure is raising erORA-21779: duration not active.
609083Mar 10 2008 — edited Mar 11 2008Hi there,
am using Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 and facing typical type of error
please find the steps below to reproduce it
in this basically i will pass a comma seperated values and function will return the
piped table witheach seperated values as new record
ex :1,2,3,4
1
2
3
4
Types created:
1) Create Type TPOBJ_ReturnTable as Object (tnames varchar2 (2000));
2) Create Type TPObjT_ReturnTable as Table Of TPOBJ_ReturnTable;
Function created:
CREATE OR REPLACE FUNCTION WB_FN_ReturnTable
(
tNameString IN VARCHAR2
)
RETURN TPObjT_ReturnTable
PIPELINED
AS
iOptionSel INT;
tOptionSel VARCHAR2 (9);
iLen INT;
tName VARCHAR2 (50);
tTempChar CHAR (1);
ptNameString VARCHAR2(2000);
BEGIN
ptNameString:=tNameString;
iLen := LENGTH(TRIM(ptNameString));
iOptionSel := 1;
tName := '';
WHILE iOptionSel <= iLen
LOOP
tTempChar := SUBSTR(ptNameString, iOptionSel, 1);
IF tTempChar = ',' THEN
IF LENGTH(TRIM(tName)) > 0 THEN
PIPE ROW(TPOBJ_ReturnTable(tName));
END IF;
tName := '';
ELSE
tName := tName || tTempChar;
END IF;
iOptionSel := iOptionSel + 1;
END LOOP;
IF LENGTH(TRIM(tName)) > 0 THEN
PIPE ROW(TPOBJ_ReturnTable(tName));
END IF;
ptNameString:='';
END;
Table created:
Create Table test (id (16))
Insert into test values (1)
Please insert from 1 to 10.
Stored procedure created:
Create or replace Sptest
As
pitems Varchar2(255);
pvalue Number(16);
Begin
Titems :=’5,4,3’;
Select MIN(id) into pvalue from test where id not in
(select tnames from table(WB_FN_ReturnTable(Titems ));
End;
Note:
while executing the sp for the first time am not getting any error
only ,if making a repeated call for execution then am gettings the errors specified below
ORA-21779: duration not active
ORA-03113: end-of-file on communication channel
ORA-03114: not connected to ORACLE
can anyone help me on these issue