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 -> Error in executing Dynamic Function

Error in executing Dynamic Function

From: Basant <basantshanker_at_hotmail.com>
Date: 19 Feb 2004 01:11:18 -0800
Message-ID: <e3fbec7a.0402190111.39d1223e@posting.google.com>


Hi ,  

   I am trying to create a Function Dynamically. After creating function if I called it immediately then first time it is working fine whereas second continuous execution in same session is giving following error:
ERROR at line 1:
ORA-00600: internal error code, arguments: [17285], [240339652], [1], [72604516], [], [], [], []

ORA-06512: at "SYS.DBMS_SYS_SQL", line 824
ORA-06512: at "SYS.DBMS_SQL", line 32
ORA-06512: at "BSVSTD.BASANTDOTNET", line 23
ORA-06512: at line 4

Following is the package which I wrote to create dynamic funciton..

create or replace package basantdotnet is procedure p1 (i_string IN varchar2);
Procedure p2 (i_FinanceRecordType IN OUT basanttest.recordtype); end basantdotnet;

create or replace package body basantdotnet is procedure p1 (i_string IN varchar2) is

i_RuleString      VARCHAR2(200);
l_String     VARCHAR2(8000);
l_Variable   NUMBER;
CID          INTEGER;
l_status     INTEGER;

BEGIN
i_ruleString := i_string;

   cid := DBMS_SQL.OPEN_CURSOR;
   l_String := 'Create or Replace Function TempRuleVerifier (i_FinanceRecordType basanttest.recordtype ) Return NUMBER IS' ||

' l_Variable NUMBER;'||
' BEGIN '||
' IF '||i_RuleString ||' THEN '||

                '  l_Variable :=  1;'||
                  ' RETURN 1; '||

' ELSE '||
' l_Variable := 2;'|| ' RETURN 2; '||
' END IF; '||
' END; ';

    dbms_output.put_line(l_string);
    DBMS_SQL.PARSE(cid,l_String,DBMS_SQL.native);     l_Status := DBMS_SQL.EXECUTE(cid);
    DBMS_SQL.CLOSE_CURSOR(cid);

end p1;

Procedure p2 (i_FinanceRecordType IN OUT basanttest.recordtype) is l_number number;
begin

l_number := TempRuleVerifier (i_FinanceRecordType); IF l_number = 1 THEN

       dbms_output.put_line(' TRUE');
    ELSE
           dbms_output.put_line(' FALSE'); END IF;
end p2;
end basantdotnet;

execution step:...

declare
i_FinanceRecordType basanttest.recordtype; begin

   basantdotnet.p1('i_FinanceRecordType.UC_4=444');    dbms_output.put_line('1st stage over...');    i_FinanceRecordType.UC_4:=4;
   basantdotnet.p2(i_FinanceRecordType); end;

1st time output ....

SQL> 1st stage over...

     FALSE 2nd time ....
ERROR at line 1:
ORA-00600: internal error code, arguments: [17285], [240339652], [1], [72604516], [], [], [], []

ORA-06512: at "SYS.DBMS_SYS_SQL", line 824
ORA-06512: at "SYS.DBMS_SQL", line 32
ORA-06512: at "BSVSTD.BASANTDOTNET", line 23
ORA-06512: at line 4


Please help me out...

Thanks in Advance...

Basant Received on Thu Feb 19 2004 - 03:11:18 CST

Original text of this message

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