Home » SQL & PL/SQL » SQL & PL/SQL » character string buffer too small error in function (oracle 10g,windows 8)
character string buffer too small error in function [message #648614] Sat, 27 February 2016 03:08 Go to next message
amar.podaralla@gmail.com
Messages: 3
Registered: February 2016
Location: kuwait
Junior Member
Dear All,

When i am executing the following function i am getting the following error

ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at "APPS.XX_TEST", line 26

create or replace function XX_TEST return varchar2 is
v_dtno  varchar2(10000);
begin
V_DTNO := NULL;
    for rec1 in (select 
   rct.ATTRIBUTE2||rct.ATTRIBUTE10||rct.ATTRIBUTE11  DTNO
   FROM     ra_customer_trx_all rtl,
    oe_order_headers mm,
             ar_customers ac,
             ra_customer_trx_lines_all rct,
             ra_cust_trx_line_gl_dist_all rgd
WHERE   ac.customer_id = rtl.bill_to_customer_id
AND     to_char(mm.order_number(+))= rtl.interface_header_attribute1
AND     rct.customer_trx_id = rtl.customer_trx_id
AND     rct.customer_trx_line_id = rgd.customer_trx_line_id
AND     rgd.customer_trx_id=41678
and     rct.inventory_item_id =413
group by rct.INVENTORY_ITEM_ID , rct.ATTRIBUTE2||rct.ATTRIBUTE10||rct.ATTRIBUTE11  
 ) 
    Loop
            V_DTNO := V_DTNO ||'-'||REC1.DTNO;
    End loop;
    
    dbms_output.put_line(' dt no is '||v_dtno);

return v_dtno;
end;


Can any one please help me how to solve the above issue..

Thanks in advance.

Best Regards
*BlackSwan added {code} tags. Please do so yourself in the future.

[Updated on: Sat, 27 February 2016 09:07] by Moderator

Report message to a moderator

Re: character string buffer too small error in function [message #648616 is a reply to message #648614] Sat, 27 February 2016 03:12 Go to previous messageGo to next message
John Watson
Messages: 8929
Registered: January 2010
Location: Global Village
Senior Member
Welcome to the forum. Please read our OraFAQ Forum Guide and How to use [code] tags and make your code easier to read

Which is line 26? I'm not going to count for you.

[Updated on: Sat, 27 February 2016 03:12]

Report message to a moderator

Re: character string buffer too small error in function [message #648620 is a reply to message #648616] Sat, 27 February 2016 09:10 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>(oracle 10g,windows Cool(oracle 10g,windows Cool
nice unsupported combination of Oracle version & OS
Oracle 10g is obsoleted & unsupported.
Please join 21st Century at your earliest convenience.
Re: character string buffer too small error in function [message #648621 is a reply to message #648616] Sat, 27 February 2016 09:23 Go to previous messageGo to next message
amar.podaralla@gmail.com
Messages: 3
Registered: February 2016
Location: kuwait
Junior Member
Hi John,

Thanks for the reply.

line 26 is return v_dtno;

Best Regards

Re: character string buffer too small error in function [message #648622 is a reply to message #648621] Sat, 27 February 2016 09:27 Go to previous messageGo to next message
John Watson
Messages: 8929
Registered: January 2010
Location: Global Village
Senior Member
10g SQL varchars have max length 4000. You can't return a PL/SQL varchar greater than that to SQL. You'll need to upgrade to 12.x and enable extended strigs, or use CLOBs.
Re: character string buffer too small error in function [message #648624 is a reply to message #648622] Sat, 27 February 2016 09:30 Go to previous messageGo to next message
amar.podaralla@gmail.com
Messages: 3
Registered: February 2016
Location: kuwait
Junior Member
Hi john,

Sorry i was updated it wrongly,its a " Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production ".


Thanks & Best Regards
Re: character string buffer too small error in function [message #648625 is a reply to message #648624] Sat, 27 February 2016 09:39 Go to previous message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
amar.podaralla@gmail.com wrote on Sat, 27 February 2016 07:30
Hi john,

Sorry i was updated it wrongly,its a " Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production ".


Thanks & Best Regards

above does not change 4000 character limit
Previous Topic: Setting LIMIT value while using Bulk Collect
Next Topic: Volume Apportioned to right volumen bands
Goto Forum:
  


Current Time: Fri Apr 19 03:20:46 CDT 2024