Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: pl/sql problem

Re: pl/sql problem

From: <Diana_Duncan_at_ttpartners.com>
Date: Wed, 06 Jun 2001 17:56:45 -0700
Message-ID: <F001.0031F722.20010606164553@fatcity.com>

In addition to the reason for your error, which someone else has pointed out, this piece of code has another problem -- you never close your cursor. This will get you into no ends of trouble at some point in the future, so I though I should point it out. Also, a cursor for loop would be much cleaner, and you won't have to worry about closing the cursor. Like the following...

declare

     cursor c1 is
          select nm_enum_data
          from t_enum_data
          where id_enum_data in
               (select distinct id_view from t_acc_usage_1
               union
               select distinct id_view from t_acc_usage_2
               union
               select distinct id_view from t_acc_usage_3
          );
     --enum t_enum_data.nm_enum_data%type;    Don't need this variable
declaration any more
begin
     dbms_output.enable(900000);   -- This can be a value up to 999999
     for enumRec in c1 loop
          dbms_output.put_line(enumRec.nm_enum_data);
     end loop;

end;
/

Diana Duncan
TITAN Technology Partners
One Copley Parkway, Ste 540
Morrisville, NC 27560
VM: 919.466.7337 x 316
F: 919.466.7427
E: Diana_Duncan_at_ttpartners.com

                                                                                       
                                    
                    Harvinder Singh                                                    
                                    
                    <Harvinder.Singh_at_Metr        To:     Multiple recipients of list 
ORACLE-L <ORACLE-L_at_fatcity.com>       
                    aTech.com>                   cc:                                   
                                    
                    Sent by:                     Fax to:                               
                                    
                    root_at_fatcity.com             Subject:     pl/sql problem           
                                    
                                                                                       
                                    
                                                                                       
                                    
                    06/06/2001 06:05 PM                                                
                                    
                    Please respond to                                                  
                                    
                    ORACLE-L                                                           
                                    
                                                                                       
                                    
                                                                                       
                                    




Hi,

i am running following code

declare
cursor c1 is
select nm_enum_data from t_enum_data where id_enum_data in
(select distinct id_view from t_acc_usage_1
union
select distinct id_view from t_acc_usage_2 union
select distinct id_view from t_acc_usage_3 );
enum t_enum_data.nm_enum_data%type;
begin
open c1;
loop
fetch c1 into enum;
exit when c1%notfound;
dbms_output.put_line(enum);
end loop;
end;
/

i am getting error:
declare
*
ERROR at line 1:

ORA-20000: ORU-10027: buffer overflow, limit of 2000 bytes
ORA-06512: at "SYS.DBMS_OUTPUT", line 91
ORA-06512: at "SYS.DBMS_OUTPUT", line 58
ORA-06512: at line 16

What might be the reason????????

Thanks
Harvinder

--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Harvinder Singh
  INET: Harvinder.Singh_at_MetraTech.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L

(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: Diana_Duncan_at_ttpartners.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
Received on Wed Jun 06 2001 - 19:56:45 CDT

Original text of this message

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