"buffer too small for string or missing null byte" inserting CR in excel

I have created a Crystal Report based on below stored procedure.
DELIMITER $$
DROP PROCEDURE IF EXISTS `ww_test`.`PRD_Data_sp` $$
CREATE PROCEDURE `ww_test`.`PRD_Data_sp` (in cyear int, in cmonth int, in groupby varchar(20), in Inv_type varchar(4))
BEGIN
  select
          CASE WHEN groupby='Date' THEN  (p.FKDAT)
               WHEN groupby='SalesOrg' THEN  CONCAT(p.VKORG,'_',p.VTWEG)
          END ,
          sum(p.QTYSAM),
          sum(p.CASESSOLD),
          sum(p.SOLDDOL)
          from ww_test.prd_data p
          where (month(p.FKDAT)=cmonth and year(p.FKDAT)=cyear) and
                 ((p.FKART) is null or not(p.FKART in ("FAZ","ZMBB","FAS",Inv_Type))) and
                 ((p.AUART) is null or not(p.AUART in ("ZMBB")))
          Group by
              CASE WHEN groupby='Date' THEN  (p.FKDAT)
                   WHEN groupby='SalesOrg' THEN  CONCAT(p.VKORG,'_',p.VTWEG)
              END
          Order by
              CASE WHEN groupby='Date' THEN  (p.FKDAT)
                   WHEN groupby='SalesOrg' THEN  CONCAT(p.VKORG,'_',p.VTWEG)
              END;
END $$
DELIMITER ;
I have used Add Command to create report based on this.
call ww_test.prd_data_sp({?Year},{?Month},{?GroupBy},{?InvType});
I am able to refresh the report in crystal and as well in Infoview without any problem.
But when i try to insert this report in Excel using Live Office it gives me error. I able to insert other crystal reports without any problem.
An error occurred while opening the report. The report does not exist; you have insufficient rights to open the report; or you cannot make a connection to the BusinessObjects Web Service. (LO 02010)
Failed to open report (LO 26619)
Cannot open report document 
Buffer too small for string or missing null byte.
can anyone suggest where i am going wrong? Any input is appreciated.
Crystal Reports 2008
Live Office XI 3.1
BOEdge XI 3.1
Xcelsius 2008
Thanks ,
Madhavi

With the CurrentValue method
Crpt.ParamFields[3].CurrentValue := memo1.Text;
Is there another solution ?

Similar Messages

  • Buffer too small for string - Crystal Report for Vs2010

    Hello,
        I have recently upgrade my VS2010 project to Crystal Report for Visual Studion 2010.
        I have some reports that contains more than 512 characters in the Report Comments section.
        When I try to do a RptDoc.SaveAs(vPath, false) the following error is raised:
    Buffer too small for string or missing null byte.
          at CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.SaveAs in :line 0
          at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.SaveAs in :line 0
          at CrystalDecisions.CrystalReports.Engine.ReportDocument.SaveAs in :line 0
        This line SaveAs was working has expected with Crystal Report 2008. Any idea on why it is not working anymore.
    Thank you.
    Charles

    Hello Don,
        I have start a little project to retest the behavior.
       I have create a new report in Crystal Report 2008 just by clicking New, Finish and Save.
       In a new Windows Application in Vs2010 ,I have added the following Crystal Report Reference.
        CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0
       CrystalDecisions.Shared, Version=13.0.2000.0
    I have then try the following code and found out the limit of ReportComment is 511 but in the Crystal Report 2008 designer and runtime the limit did not apply.
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
          Dim objRpt As New CrystalDecisions.CrystalReports.Engine.ReportDocument()
          Dim i As Integer = 0
          Try
             objRpt.Load("c:\temp\empty.rpt", CrystalDecisions.Shared.OpenReportMethod.OpenReportByTempCopy)
             Do
                i += 1
                objRpt.SummaryInfo.ReportComments = New String("X", i)
             Loop
             objRpt.SaveAs("c:\temp\dfh_save.rpt", False)
          Catch ex As Exception
             MsgBox("i: " & i)
             MsgBox(ex.Message)
          End Try
    End Sub
         I am able to put has many characters if I insert the report in the Vs2010 Solution.
         If you prefer I can send you my little project.
    Thank you.
    Charles
    <code> should be
    Edited by: Don Williams on Feb 4, 2011 12:47 PM

  • ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion

    Hi all,
    the following query select to_char(nvl(round(pc.target_cost*xx_primavera.geteurtolvrate,2),amount),'FM999G999G999G999G990D00') detail_amount,
    nvl(ct.cost_type, description) detail_description,
    tm_desc.memo_id,
    primavera_prj_name detail_prj_name,
    hp.party_number detail_party_number,
    xpid.interface_line_attribute1,
    utl_i18n.unescape_reference(replace(regexp_replace(utl_raw.cast_to_varchar2(tm_desc.task_memo), '<[^>]*>'), chr(13)||chr(10))) document_description,
    REPLACE(regexp_replace(utl_raw.cast_to_varchar2(tm_id.task_memo), '<[^>]*>'), chr(13)||chr(10)) prim_memo_client_id
    from XX_PRIMAVERA_INVOICES_DETAIL xpid
    join admuser.xx_ar_hz_parties xahp on xahp.orig_system_bill_customer_id = xpid.orig_system_bill_customer_id
    join hz_parties hp on hp.party_id = xahp.party_id
    left join admuser.projcost pc on pc.proj_id = xpid.primavera_prj_id and pc.cost_type_id != 29 and xpid.service_code = 8 and pc.task_id = xx_primavera.getTaskId(xpid.primavera_prj_id,'A1020', 'Изготвяне на оферта') and delete_session_id is null
    left join admuser.costtype ct on ct.cost_type_id = pc.cost_type_id
    left join admuser.taskmemo tm_id on tm_id.proj_id = xpid.primavera_prj_id and tm_id.memo_type_id = 53 and tm_id.task_id = xx_primavera.getTaskId(xpid.primavera_prj_id,'A1020', 'Изготвяне на оферта')
    left join admuser.taskmemo tm_desc on tm_desc.proj_id = xpid.primavera_prj_id and tm_desc.memo_type_id = 55 and tm_desc.task_id = xx_primavera.getTaskId(xpid.primavera_prj_id,'A1020', 'Изготвяне на оферта')
    where amount != 0
      and xpid.interface_line_attribute1 = :ra_ctp_attribute1
    ORDER BY xpid.primavera_prj_name, xpid.description;returns error:
    ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 2371, maximum: 2000) I found that the error occurs in the row : utl_i18n.unescape_reference(replace(regexp_replace(utl_raw.cast_to_varchar2(tm_desc.task_memo), '<[^>]*>'), chr(13)||chr(10))) document_description,and tried to change it to: utl_i18n.unescape_reference(replace(regexp_replace(utl_raw.cast_to_varchar2(dbms_lob.substr(tm_desc.task_memo,1,2000)), '<[^>]*>'), chr(13)||chr(10))) document_description,....but it returns not value for that field... am i using dbms_lob.substr at the wrong place? The column 'tm_desc.task_memo' is BLOB type.
    Any ideas how to cheat it ?
    Version: Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
    PL/SQL Release 11.1.0.7.0 - Production
    "CORE     11.1.0.7.0     Production"
    TNS for Linux: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - ProductionThanks in advance,
    Bahchevanov.

    Your second example has the parameters reversed. The amount (length) comes first and then the offset:
    DBMS_LOB.SUBSTR (
       lob_loc     IN    BLOB,
       amount      IN    INTEGER := 32767,
       offset      IN    INTEGER := 1)
      RETURN RAW;
    DBMS_LOB.SUBSTR (
       lob_loc     IN    CLOB   CHARACTER SET ANY_CS,
       amount      IN    INTEGER := 32767,
       offset      IN    INTEGER := 1)
      RETURN VARCHAR2 CHARACTER SET lob_loc%CHARSET;
    DBMS_LOB.SUBSTR (
       file_loc     IN    BFILE,
       amount      IN    INTEGER := 32767,
       offset      IN    INTEGER := 1)
      RETURN RAW;Also, remember that # of bytes is not necessarily the same as the # of characters depending on your character set. So 2000 bytes might become 4000 characters. And you have to make sure the BLOB is actually character data and not arbitrary binary data.
    Post the results of reversing the parameters and using a smaller chunk size.

  • ORA-22835: Buffer too small for CLOB to CHAR  on Solaris but not Windows

    Hi,
    I get the following error on Solaris but not Windows equivalent 10.2 installations
    ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 4575, maximum: 4000)
    ORA-06512: at line 65
    the code causing the problem is:
    SELECT A.TABLE_NAME, A.DEFAULT_DIRECTORY_NAME, B.LOCATION,
    CASE
    WHEN INSTR(A.ACCESS_PARAMETERS,'RECORDS FIXED')<>0 THEN
    SUBSTR(A.ACCESS_PARAMETERS,INSTR(A.ACCESS_PARAMETERS,'RECORDS FIXED')+14,3)
    ELSE NULL
    END RSZ FROM USER_EXTERNAL_TABLES A, USER_EXTERNAL_LOCATIONS B
    WHERE A.TABLE_NAME = B.TABLE_NAME(+);
    the entire code being executed is:
    DECLARE
    EX BOOLEAN;
    CNT NUMBER;
    SQL1 VARCHAR2(4000);
    FLEN NUMBER;
    BSIZE NUMBER;
    TABNAME VARCHAR2(4000);
    DEFDIR VARCHAR2(4000);
    RSZ VARCHAR2(4000);
    ECODE NUMBER(38);
    ERRMSG VARCHAR2(4000);
    CURSOR C1 IS
    SELECT A.TABLE_NAME, A.DEFAULT_DIRECTORY_NAME, B.LOCATION,
    CASE
    WHEN INSTR(A.ACCESS_PARAMETERS,'RECORDS FIXED')<>0 THEN
    SUBSTR(A.ACCESS_PARAMETERS,INSTR(A.ACCESS_PARAMETERS,'RECORDS FIXED')+14,3)
    ELSE NULL
    END RSZ FROM USER_EXTERNAL_TABLES A, USER_EXTERNAL_LOCATIONS B
    WHERE A.TABLE_NAME = B.TABLE_NAME(+);
    TYPE C1_TYPE IS TABLE OF C1%ROWTYPE;
    REC1 C1_TYPE;
    BEGIN
    OPEN C1;
    FETCH C1 BULK COLLECT INTO REC1;
    FOR I IN REC1.FIRST .. REC1.LAST
    LOOP
    UTL_FILE.FGETATTR(NVL(REC1(I).DEFAULT_DIRECTORY_NAME,'CARDSLOAD'),
    REC1(I).LOCATION, EX, FLEN, BSIZE);
    IF EX THEN
    IF INSTR(TO_CHAR(REC1(I).RSZ),'\.')<>0 THEN
         DBMS_OUTPUT.PUT_LINE('INVALID RECORDSIZE OR CORRUPTED FILE');
         END IF;
         DBMS_OUTPUT.PUT_LINE('Table Name: ' || TO_CHAR(REC1(I).TABLE_NAME));     
    DBMS_OUTPUT.PUT_LINE('File Exists '||REC1(I).LOCATION);
         DBMS_OUTPUT.PUT_LINE('File Length: ' || TO_CHAR(FLEN));
         DBMS_OUTPUT.PUT_LINE('Record Size: ' || TO_CHAR(REC1(I).RSZ));
    DBMS_OUTPUT.PUT_LINE('Block Size: ' || TO_CHAR(BSIZE));
         DBMS_OUTPUT.PUT_LINE('# RECORDS: ' || FLEN/TO_NUMBER(REC1(I).RSZ));
         BEGIN
         CNT:='';
         SQL1:='SELECT COUNT(*) FROM '|| REC1(I).TABLE_NAME;
         EXECUTE IMMEDIATE SQL1 INTO CNT;
    DBMS_OUTPUT.PUT_LINE('SELECT COUNT FOR: ' || REC1(I).TABLE_NAME||' = '||CNT);
         EXCEPTION
         WHEN OTHERS THEN
         DBMS_OUTPUT.PUT_LINE('SELECT COUNT FAILED FOR: ' || REC1(I).TABLE_NAME);
         ECODE := SQLCODE;
    ERRMSG := SQLERRM;
    DBMS_OUTPUT.PUT_LINE(ECODE||' '||ERRMSG);
         END;
    ELSE
    DBMS_OUTPUT.PUT_LINE(REC1(I).TABLE_NAME||' '||REC1(I).LOCATION||' File Does Not Exist');
    END IF;
         DBMS_OUTPUT.PUT_LINE('-----------------------------------------------------');
    END LOOP;
    CLOSE C1;
    EXCEPTION
    WHEN OTHERS THEN RAISE;
    END;
    Any ideas why Solaris but not Windows would have this problem?
    Thanks,
    Victor

    Check out Bug 4715104 - ORA-22835 / truncated data from USER/ALL/DBA_EXTERNAL_TABLES

  • APEX BUG ?  Buffer too small for CLOB to CHAR or BLOB to RAW

    Hi
    I tried use search field (right top corner) in Application Builder for my APP. After while a had:
    report error:
    ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 8000, maximum: 4000)
    I changed my main table and now I would like search every appearance in app, I thought it's the best solution to use search.
    Do you know how resolve my problem.
    APEX ver 4.0.1.00.03

    You can't...there's a limit of 4k for any page item in apex....attempting to convert or bring in more into a page item or even from an app process into a javascript variable, kicks that error.
    It's a limitation with mod_plsql, there's a fix in 4.0 but it requires using the java listener instead of mod_plsql.

  • Report error: ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW c

    report error:
    ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 7106, maximum: 4000)
    Has anyone come across this error?
    We're inputing text using the HTML Editor Minimal. The text is saving fine, but large text inputs, when combined with the html tags, cannot be retrieved from the database, i just get the above error. I believe there is an associated DB bug for this, but i'm curious if anyone has come across this before, and if they found a work-around?

    Did you solve this?
    I have a similar problem, as posted in CLOBs Quit Working Due to > 4000 chars - ORA-22835
    Thanks,
    --BobC                                                                                                                                                                                                                                                                                           

  • ORA-22835: buffer too small when trying to save pdf file in LONG RAW column

    Hi,
    I get "ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (real : 125695, maximum : 2000)" when i trying to save a 120k pdf file in an Oracle Long Raw column using dotnet 4.0 and Entity FrameWork.
    Dim db As New OracleEntities
    Try
    Dim myEntity = (From e In db.TEXTE _
    Where e.TEXT_ID = txtTextId.Text _
    Select e).Single
    With myEntity
    If txtTextypeId.Text <> "" Then
    .TEXTYPE_ID = txtTextypeId.Text
    Else
    .TEXTYPE_ID = Nothing
    End If
    .TEXT_NUM = txtTextNum.Text
    .TEXT_NAME = txtTextName.Text
    .TEXT_DATE = dtTextDate.SelectedDate
    If DocAdded Then
    .TEXT_DOC = Document
    ElseIf DocDeleted Then
    .TEXT_DOC = Nothing
    End If
    End With
    db.SaveChanges()
    Document is an array of Byte and TEXT_DOC also (mapped to a long row column).
    is it possible to increase the size of the buffer ? how may i do it ?
    Thx in advance.
    Regards.

    Using a custom UPDATE or INSERT stored procedure for LONG RAW column with
    exceed-limit data may still get the following error.
    "ORA-01460: unimplemented or unreasonable conversion requested".
    One option is to use BLOB instead of LONG RAW in your table and regenerate your
    data model from the table. Then using the default UPDATE or INSERT statement
    (created by EF) should work.
    The following will modify your LONG RAW column to BLOB column.
    Disclaimers:
    1. It's irreversible--you cannot modify BLOB back to LONG RAW.
    2. I have not tried that when there are huge data in LONG RAW column.
    So be careful.
    alter table <your_table_name> modify <your_long_raw_type_column> blob;

  • ORA-06502 (character string buffer too small) on import application via script

    Running apex 4.2.2.00.11
    oracle 10.2.0.5
    I'm using a script to import my development application to a few production applications.
    It worked great on apex 4.1.1, but now I get an 'ORA-06502 PL/SQL numeric of value error: character string buffer too small'
    In the command window, I see that the script fails after it starts on the plugins.
    My question: is this a bug in 4.2.2?
    I could be a incompatible plugin, but how can I found out which plugin?
    My script is quite simple:
    In a command window I run
    sqlplus SCHEMA/PASSWORD@SPIEU10 @_IMPORT_F102.sql
    The script is
    declare
    l_workspace_id number;
    begin
        -- determine the workspace id for the workspace FM in the target system
        select workspace_id into l_workspace_id from apex_workspaces where workspace = 'BY_APEX_SHARED';
        -- set the context for the target workspace
        apex_application_install.set_workspace_id( l_workspace_id );
        -- override the original application id 102
        apex_application_install.set_application_id ( 102 );
        -- set a different application name and alias, it should be unique within an APEX instance
        apex_application_install.set_application_alias( 'MY_ALIAS' );
        apex_application_install.set_application_name( 'MY_APP_NAME' );
        -- Use fixed offset
        apex_application_install.set_offset( p_offset => 0);
        -- override the original parsing schema FM with a different value
        apex_application_install.set_schema( 'BY_SCHEMA' );
    end;
    -- install the original application export, now the values for the workspace
    @f102.sql
    exit;
    Error message from command window:
    ...ui types
    ...plugins
    begin
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at line 3
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64
    bit Production
    With the Partitioning, Data Mining and Real Application Testing options

    ListAGG throws an ORA-01489 for varchar2 > 4000 bytes
    OP has an ORA-06502 --> the IR is running into a 4k/32k limit.
    quick solution: wrap USER_COMMENTS ListAGG in a substr( ...., 1, 4000)
    Longer solution, use a subquery to modify the comments based on ROW_NUMBER() (ie after nth row, change it to NULL)
    with
    -- simulating data
    t as (select task_id, sysdate - lv as date_entered
      ,round(dbms_random.value(1,24)) hours
      , '-*' || lv || '.' || task_id || '*-' as user_comments
    from ( select level as task_id from dual connect by level <=10 ), (select level lv from dual connect by level < 1000)
    -- modify data
    modified_data as (
      select task_id, hours, date_entered
        ,case
          when row_number() over (partition by task_id order by date_entered desc) < 5
            then user_comments
          else null
         end USER_COMMENTS
        from t)
    select task_id, sum(hours) total_hours,
      listagg( user_comments  ) within group (order by date_entered desc)
      || case when count(*) >= 5 then '! MORE COMMENTS !' else null end
        as user_comments
    from modified_data
    group by task_id;

  • ORA-06502 PLSQL Numeric or value error character string buffer too small

    Hi
    Gurus help!!
    I received error message "ORA-06502: PL/SQL:Numeric or value error: character strong buffer too small." I use example code of "AJAX Get Multiple Values Tabular I" from Denes Kubicek http://apex.oracle.com/pls/otn/f?p=31517:239.
    I did
    1) create an application process on demand (set_multi_items_tabular)
    2) create two application items (temporary_application_item and t_rownum)
    3) create a report page (I assume) and put the below into the page header
    <script language="JavaScript" type="text/javascript">
    function f_set_multi_items_tabular(pValue, pRow){
    var get = new htmldb_Get(null,html_GetElement('pFlowId').value,
    'APPLICATION_PROCESS=Set_Multi_Items_Tabular',0);
    if(pValue){
    get.add('TEMPORARY_APPLICATION_ITEM',pValue)
    get.add('T_ROWNUM',pRow)
    }else{
    get.add('TEMPORARY_APPLICATION_ITEM','null')
    gReturn = get.get('XML');
    if(gReturn){
    var l_Count = gReturn.getElementsByTagName("item").length;
    for(var i = 0;i<l_Count;i++){
    var l_Opt_Xml = gReturn.getElementsByTagName("item");
    var l_ID = l_Opt_Xml.getAttribute('id');
    var l_El = html_GetElement(l_ID);
    if(l_Opt_Xml.firstChild){
    var l_Value = l_Opt_Xml.firstChild.nodeValue;
    }else{
    var l_Value = '';
    if(l_El){
    if(l_El.tagName == 'INPUT'){
    l_El.value = l_Value;
    }else if(l_El.tagName == 'SPAN' && l_El.className == 'grabber'){
    l_El.parentNode.innerHTML = l_Value;
    l_El.parentNode.id = l_ID;
    }else{
    l_El.innerHTML = l_Value;
    get = null;
    </script>
    4) Report Query is
    SELECT apex_item.select_list_from_query
    (31,
    NULL,
    'SELECT FIRST_NAME d, ' || 'EMPLOYEE_ID r FROM EMPLOYEES',
    'style="width:250px" '
    || 'onchange="f_set_multi_items_tabular(this.value,''#ROWNUM#'''
    || ')"',
    'YES',
    '0',
    '- Select FIRST NAME -',
    'f31_' || '#ROWNUM#',
    NULL,
    'NO'
    ) BOOK,
    apex_item.text (32,
    NULL,
    80,
    100,
    'style="width:190px" ',
    'f32_' || '#ROWNUM#'
    ) FIRST_NAME,
    apex_item.text (33,
    NULL,
    80,
    100,
    'style="width:190px" ',
    'f33_' || '#ROWNUM#'
    ) LAST_NAME,
    apex_item.text (34,
    NULL,
    80,
    100,
    'style="width:190px" ',
    'f33_' || '#ROWNUM#'
    ) EMAIL,
    FROM EMPLOYEES
    I did modify Denes' code from table: my_book_store and columns: subject, price, author to match my sample table: EMPLOYEES and columns: FIRST_NAME, LAST_NAME, and EMAIL.
    Am I missing some steps? Please advise and thank you in advance.
    Candice

    Stupid me!! The size of select list is too big. After I delete some record from the table, that programs. Thanks for Denes Kubicek. I guess there is limitation of select list in Apex.
    Candice

  • ORA-06502 nuemeric or value error: character string buffer too small

    i am getting above error while doing
    ORA-06502 nuemeric or value error: character string buffer too small
    ORA-06512 itw_item_add_ch at line 17
    plz urgent
    CREATE OR REPLACE procedure itw_item_add_ch (header_id1 number, folio out varchar2,tariff out varchar2) as
    cursor item_add(header_id1 number) is
    SELECT
    DISTINCT c.attribute4 item_tariff_no,
    c.attribute5 item_folio
    FROM OE_ORDER_LINES_ALL b,
         mtl_system_items c
    WHERE b.flow_status_code not in ('SHIPPED','FULFILLMENT','CLOSED')
    and      b.inventory_item_id = c.inventory_item_id
    and     b.ship_from_org_id = c.organization_id
    and b.header_id = header_id1;
    begin
    for item_att in item_add(header_id1) loop
         if folio is null then
         folio := item_att.item_folio;
         else
         folio := folio||'/'||item_att.item_folio;
         end if;
         if tariff is null then
         tariff := item_att.item_tariff_no;
         else
         tariff := tariff||'/'||item_att.item_tariff_no;
         end if;
         end loop;
    end;

    if you want to find out which of your two variables are causing the problem, then use pragma exception_init along with "begin end exception" blocks within the loop.
    I've removed the procedure specification, so you can test this in SQL Plus. You need to supply a number to the Header_id1 variable something like this:
    set serveroutput on
    begin
      header_id1 number := 1; -- supply your own parameter here
      cursor Item_Add(Header_Id1 number) is
        select
              distinct c.Attribute4 Item_Tariff_No
             ,c.Attribute5          Item_Folio  
        from  Oe_Order_Lines_All    b
             ,MTL_System_Items      c
        where b.Flow_Status_Code    not in ('SHIPPED','FULFILLMENT','CLOSED')
        and   b.Inventory_Item_Id   = c.Inventory_Item_Id
        and   b.Ship_From_Org_Id    = c.Organization_Id
        and   b.Header_Id           = Header_Id1;
      exception TOO_MANY_CHARS;
      exception TOO_TARIFF_CHARS;
      pragma exception_init(TOO_MANY_CHARS, -6502);
      l_Folio varchar2(32747);
      l_Tariff varchar2(32747);
      l_Folio_Continue boolean  := true;
      l_Tariff_Continue boolean := true;
    begin
      for Item_Att in Item_Add(Header_Id1) loop
        if (l_Folio_Continue) then
          begin
            if l_Folio is null then
              l_Folio := Item_Att.Item_Folio;
            else
              l_Folio := l_Folio||'/'||Item_Att.Item_Folio;
            end if;
          exception
            when TOO_MANY_CHARS then
              dbms_output.put_line ('Foilio has too many values ');
              l_Folio_Continue := false;
              exit;
          end;
        end if;
        if (l_Tariff_Continue) then
          begin
            if l_Tariff is null then
              l_Tariff := Item_Att.Item_Tariff_No;
            else
              l_Tariff := l_Tariff||'/'||Item_Att.Item_Tariff_No;
            end if;
          exception
            when TOO_MANY_CHARS then
              dbms_output.put_line ('Tariff has too many values ');
              l_Tariff_Continue := false;
              exit;
        end if;
      end loop;
    end;
    /this is untested, so please sort out any compilation errors yourself.

  • ORA – 06512: Character String Buffer Too Small.

    hi..
    when i'm call the Stored Procedure from php i'm getting this error
    ORA – 06512: Character String Buffer Too Small.
    but its working fine via pl/sql block in sqlplus
    CREATE OR REPLACE procedure sp_RecurringDetails(v_p in out pmxpackage.gen ,v_pmCount in out number, v_pmResult in out number) is
    v_Stmt varchar2(4000);
    v_stmtcount varchar2(4000);
    begin
    v_Stmt:= 'SELECT orders.ord_id, sub.smt_id, sub.smt_date,
    MEMBER.mem_fname,
         MEMBER.mem_lname,
         sub.smt_amount,
         sub.smt_qty,
    sub.smt_pv
         FROM MEMBER MEMBER,
         orders orders,
         sub_monthly_track sub
    WHERE ( (MEMBER.mem_id = orders.ord_memid)
    AND (MEMBER.mem_id = sub.smt_mem_id)
              AND ORDERS.ORD_RECURRING=2
              and member.MEM_DEL_STATUS=''N''
              and smt_status=0
    union
    (SELECT orders.ord_id, null,null,
    MEMBER.mem_fname,
         MEMBER.mem_lname,
         null,
         null,
    null
         FROM MEMBER MEMBER,
         orders orders
    where
    MEMBER.mem_id = orders.ord_memid
    and
    orders.ORD_RECURRINGID=2
    and orders.ord_status=''f'') order by ord_id     ';
              v_stmtcount:='select count(*) from ('||v_stmt||')';
    if (v_pmCount=-1) then
    dbms_output.put_line('');
              EXECUTE IMMEDIATE ' set serveroutput on';
              EXECUTE IMMEDIATE v_stmtcount INTO v_pmCount;
    end if;
    open v_p for v_stmt ;
    v_pmResult:=1;
    exception
    when others then
    null;
    end;
    when i'm gettting Count from the Stored Procedure sp returns the error... other wise its working fine in php
    pls give the solution for this issue
    Thanks,
    Message was edited by:
    venkatraman.L

    Tx for ur Response
    I didnt get any log when i excute this..... But it is woking fine in pl/sql Block .. But when i call from PHP page it Gives the Error
    Re: ORA – 06512: Character String Buffer Too Small.
    CREATE OR REPLACE procedure sp_RecurringDetails(v_p in out pmxpackage.gen ,v_pmCount in out Integer, v_pmResult in out Integer) is
    v_Stmt varchar2(4000);
    v_stmtcount varchar2(4000);
    v_ErrMsg varchar(1000);
    v_Errorcode number;
    begin
    v_ErrMsg:='Data--'||'Param1 is Cursor'||'--' ||Pmxpackage.Fun_Param(v_pmCount,'Param2 is null')||'--' ||Pmxpackage.Fun_Param(v_pmResult,'Param3 is null');
         IF v_pmCount IS NULL OR v_pmResult IS NULL THEN
         Pmxpackage.sp_pmxerrorlog(v_ErrMsg,'sp_RecurringDetails');
              v_pmResult:=0;
              dbms_output.put_line('nulld is ');
              RETURN ;
         END IF;
    v_Stmt:= 'SELECT orders.ord_id, sub.smt_id, sub.smt_date,
    MEMBER.mem_fname,
         MEMBER.mem_lname,
         sub.smt_amount,
         sub.smt_qty,
    sub.smt_pv
         FROM MEMBER MEMBER,
         orders orders,
         sub_monthly_track sub
    WHERE ( (MEMBER.mem_id = orders.ord_memid)
    AND (MEMBER.mem_id = sub.smt_mem_id)
              AND ORDERS.ORD_RECURRING=2
              and member.MEM_DEL_STATUS=''N''
              and smt_status=0
    union
    (SELECT orders.ord_id, null,null,
    MEMBER.mem_fname,
         MEMBER.mem_lname,
         null,
         null,
    null
         FROM MEMBER MEMBER,
         orders orders
    where
    MEMBER.mem_id = orders.ord_memid
    and
    orders.ORD_RECURRINGID=2
    and orders.ord_status=''f'') order by ord_id     ';
              v_stmtcount:='select count(*) from ('||v_stmt||')';
    if (v_pmCount=-1) then
    dbms_output.put_line('');
              EXECUTE IMMEDIATE ' set serveroutput on';
              EXECUTE IMMEDIATE v_stmtcount INTO v_pmCount;
    end if;
    open v_p for v_stmt ;
    v_pmResult:=1;
    EXCEPTION
         WHEN OTHERS THEN
              v_pmResult:=0;
              v_Errorcode:=SQLCODE;
              Pmxpackage.Sp_Pmxerrorlog(v_Errorcode,' sp_RecurringDetails',v_ErrMsg);
    end;

  • Character string buffer too small problem

    hi, guys:
    I have a question that may be silly, I got error "ORA-06502: PL/SQL: numeric or value error: character string buffer too small" when I run a query. if I uncomment "and rox.status='Active'" condition, I do not have the error. I guess it is related to some specific rows. I checked online, it looks the length of some varchar2 variable is not enough, but I just cannot find cause. I also notice there might be an error about v_level in the function, I should use number instead of varchar2 type. but after I changed the type of v_level, the error is still there. I would be cautious as this is a legacy system. Could anyone help me on this problem?
    I have a query like this:
    select *
    from registration_offender_xref rox
    where SOR_OFFENDER_DETAILS.get_offender_level(rox.offender_ID)=3
    --and rox.status='Active'
    and rox.end_registration_date is not null;I get error message as :
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at "SORS.SOR_OFFENDER_DETAILS", line 124
    06502. 00000 - "PL/SQL: numeric or value error%s"
    SOR_OFFENDER_DETAILS.get_offender_level return a number value from 1 to 3, or a null value. Here is the code
      function get_offender_level(p_offender_id IN NUMBER) return NUMBER as
          sex_offender_flag number;
          tier_level number;
          override_num number;
          v_status  varchar2(10);
          v_aggravated  varchar2(10);
          v_habitual  varchar2(10);
          v_level  varchar2(10);
          cursor tierNum is  -- as May 22, 2008 per HKT of DOC (past portal code), Level/Tier is displayed for all offenders
                   select max(c.tier)
          from sor_offense o, sor_offense_code c
                   where o.offender_id = p_offender_id
                   and o.OFFENSE_CODE = c.CODE_ID
          and upper(o.status) = 'ACTIVE';
      begin
          select count(*)
          into sex_offender_flag
          from registration_offender_xref rox
          where rox.offender_ID=p_offender_id
          and reg_type_ID=1;
          if sex_offender_flag>0 then
              OPEN tierNum;
              FETCH tierNum INTO v_level;
                if tierNum%NOTFOUND then
                tier_level := null;
                end if;
              CLOSE tierNum;
              select tier_overRide into overRide_Num
              from registration_offender_xref
              where offender_id = p_offender_id
              and reg_type_id = 1;
              if overRide_Num is not null then
                v_level:=overRide_Num;
              end if;
              --dbms_output.put_line('overRide_Num:'||overRide_Num);   
              --dbms_output.put_line('after override:'||p_level);
    /*error line*/        
                select status,  decode(aggravated,'Y','Yes','No') aggravated,
               decode(habitual,'Y','Yes','No') habitual
              into v_status,  v_aggravated, v_habitual
              from registration_offender_xref
              where offender_id = p_offender_id
              and reg_type_id = 1;
                if upper(v_status) in ('COMPLETED', 'DECEASED', 'DELETED') then
                   v_level := null;
                end if;
               --dbms_output.put_line('before final:'||p_level);
                if v_aggravated = 'Yes' or v_habitual = 'Yes' or v_level = 3 then
                   v_level := 3;
                end if;
               --dbms_output.put_line('final:'||p_level);
                if override_num is not null then
                   v_level := overRide_Num;
                end if;   
                   else
                v_level:=null;
          end if;
          return v_level;
      end get_offender_level;Thanks a lot!
    Sam
    Edited by: lxiscas on May 23, 2013 8:38 AM
    Edited by: lxiscas on May 23, 2013 8:41 AM
    Edited by: lxiscas on May 23, 2013 9:01 AM

    I'm not suggesting this is your problem, but
    select status
    into v_status,
    from registration_offender_xref But you have declared
          v_status  varchar2(10);Much better to declare things like this
          v_status  registration_offender_xref.status%type;That way you know your variable is declared with a proper length, if the column length ever changes ... your code doesn't go kaboom.
    Cheers,

  • "Character String Buffer too small" Classic Report Apex 3.2.1

    Hello Everyone,
    I know it is very old version I am discussing here but that is what we have in our environment, would really appreciate if anyone can help out.
    I have a classic report with the below query, in this I have added a filter using a select list item (P70_GROUP).
    SELECT vws.ServerID AS Display_ID,       vws.ServerID AS ID,       vws.Hostname,       vws.ServerStatus,       vws.SiteName AS Site,       vws.Client,       vws.CoreHours,       vws.Patch_Notes,       vws.PATCH_DEP,       vws.Patch_Day,       vws.PATCH_GROUPID,       vws.PATCH_TIMEID AS Time     FROM VW_Live_Support vws LEFT JOIN W_Patch_Groups wpg     ON (vws.Patch_GroupID = wpg.ID) WHERE vws.Deleteable      = 'N'   AND NVL(wpg.Ignore, 'N') = 'N'   AND ((:P70_GROUP > 1 AND vws.PATCH_GROUPID = :P70_GROUP) OR         (:P70_GROUP = 1 AND vws.Patch_GroupID IS NULL)      OR         (NVL(:P70_GROUP,0) = 0))   AND ( INSTR(UPPER(vws.HostName),    UPPER(NVL(:P70_SEARCH,vws.HostName)))    > 0 OR INSTR(UPPER(vws.ServerStatus), UPPER(NVL(:P70_SEARCH,vws.ServerStatus))) > 0 OR INSTR(UPPER(vws.SiteName),    UPPER(NVL(:P70_SEARCH,vws.SiteName)))    > 0 OR INSTR(UPPER(vws.Client),      UPPER(NVL(:P70_SEARCH,vws.Client)))      > 0 OR INSTR(UPPER(vws.CoreHours),    UPPER(NVL(:P70_SEARCH,vws.CoreHours)))    > 0 OR INSTR(UPPER(vws.Patch_Notes),  UPPER(NVL(:P70_SEARCH,vws.Patch_Notes)))  > 0       )
    Issue is when i select a group from the list I am getting
    "report error:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small".
    one unusual thing I have noticed here is when I select "All Groups" which returns 0, it is running fine and returning 3700 rows but when I select any group which returns some 10-20 rows I am getting the above error.
    can't understand why this is, please help me out.
    Regards,
    Tauceef

    Tauceef wrote:
    Thanks alot for your prompt response
    Let me add some more into the issue I forgot to add.
    It is somewhat similar to what Michael has mentioned in his first post.
    Above said report is a Tabular form and there are 3 select lists in it out of which one list is too long (Group list), when I hide it report works for all the groups.
    That should have been made clear in the original post. Reports and tabular forms are not the same thing. There's much more that can go wrong on tabular forms, including hitting the LOV size limit of 32KB for a select list item. (Obviously if you hit this limit for a single item then you've automatically hit it the report row limit as well.)
    I have explained them about the LOV that when we remove that LOV it works fine but they need that list because it is a updatable value.
    As suggested by Michael, I have tried Substr, which also works fine for all the groups.
    I would suggest client to have a short name of the groups and use it as a temporary solution.
    You should use a Pop-up LOV control for large lists of options. Purely as a usability consideration—irrespective of APEX implementation limits—select lists should only be used in cases where there are a maximum of around 200 options.
    Regarding Debugging: I am not getting that option when I run the application as a developer, checked the application properties Debugging option is selected as Yes, don't know why it is not available.
    That's not connected to this problem. Open a new thread on that topic if you want to investigate and fix it.
    One more confirmation from you guys please, I have also suggested them to upgrate the environment to the latest version, hoping this will resolve the issue, please confirm?
    In the latest version also we have same size (32KB) limit or it has been increased?
    The 32KB limits for select lists and report rows are not documented but are still present in APEX 4.2 (and in APEX 5.0 to the best of my current knowledge).

  • BI Publisher Report Query Error: "character string buffer too small"

    Using apex.oracle.com, I am trying to make a Report Query (Shared Components > Report Queries) based on many columns (around 60).
    When I enter my SQL in the "Source Query" Text Area and then click Test Report I get the following error:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small In order to try to make the simplest test case possible for this, I then tried entering SQL selecting just from DUAL.
    The following SQL fails with the error mentioned above.
    SELECT
    'wibble' as a
    ,'wibble' as b
    ,'wibble' as c
    ,'wibble' as d
    ,'wibble' as e
    ,'wibble' as f
    ,'wibble' as g
    ,'wibble' as h
    ,'wibble' as i
    ,'wibble' as j
    ,'wibble' as k
    ,'wibble' as l
    ,'wibble' as m
    ,'wibble' as n
    ,'wibble' as o
    ,'wibble' as p
    ,'wibble' as q
    ,'wibble' as r
    ,'wibble' as s
    ,'wibble' as t
    ,'wibble' as u
    ,'wibble' as v
    ,'wibble' as w
    ,'wibble' as x
    ,'wibble' as y
    ,'wibble' as z
    ,'wibble' as ab
    ,'wibble' as ac
    ,'wibble' as ad
    ,'wibble' as ae
    ,'wibble' as af
    ,'wibble' as ag
    ,'wibble' as ah
    ,'wibble' as ai
    ,'wibble' as aj
    ,'wibble' as ak
    ,'wibble' as al
    ,'wibble' as am
    ,'wibble' as an
    ,'wibble' as ao
    ,'wibble' as ap
    ,'wibble' as aq
    ,'wibble' as ar
    ,'wibble' as at
    ,'wibble' as au
    ,'wibble' as av
    FROM dualRemoving the last column from this SQL query (bringing the total number of columns down to 45) as follows and then clicking "Test Report" works successfully.
    SELECT
    'wibble' as a
    ,'wibble' as b
    ,'wibble' as c
    ,'wibble' as d
    ,'wibble' as e
    ,'wibble' as f
    ,'wibble' as g
    ,'wibble' as h
    ,'wibble' as i
    ,'wibble' as j
    ,'wibble' as k
    ,'wibble' as l
    ,'wibble' as m
    ,'wibble' as n
    ,'wibble' as o
    ,'wibble' as p
    ,'wibble' as q
    ,'wibble' as r
    ,'wibble' as s
    ,'wibble' as t
    ,'wibble' as u
    ,'wibble' as v
    ,'wibble' as w
    ,'wibble' as x
    ,'wibble' as y
    ,'wibble' as z
    ,'wibble' as ab
    ,'wibble' as ac
    ,'wibble' as ad
    ,'wibble' as ae
    ,'wibble' as af
    ,'wibble' as ag
    ,'wibble' as ah
    ,'wibble' as ai
    ,'wibble' as aj
    ,'wibble' as ak
    ,'wibble' as al
    ,'wibble' as am
    ,'wibble' as an
    ,'wibble' as ao
    ,'wibble' as ap
    ,'wibble' as aq
    ,'wibble' as ar
    ,'wibble' as at
    ,'wibble' as au
    FROM dualSo the question is: Is there a hard-coded limit of 45 columns for a Source Query? Or is there something else causing this error message?
    (For information in the above example I have "Use Generic Report Layout" selected and the output format set to "PDF")
    Thanks very much in advance for any comments or suggestions,
    Andy

    Thanks for the suggestion Simon.
    I just created a view based on the 46-column SELECT statement from dual above and then set "SELECT * FROM myview" as the Source Query.
    Unfortunately I get exactly the same error.
    Thanks,
    Andy

  • Report error:ORA-06502:character string buffer too small. urgent!!

    Hi guys,
    My APEX version is 3.0.1.00.08, my application run on my test environment, but on PROD environment, it raised the error:
    report error:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    In this page, on the left is a tree, the right side is a tabular form, when I click one tree node, it will pass the current node id to the form and the form will display the children data. When I click some tree node, it will raise the ORA-06502 error, but when click some other nodes, it is correct. I don't know why. And on my test environment, it has no this error, the test environment has same version with prod environment, only has less data in database. Could you help me???
    I searched in forum, someone says it's LOV problem, if it's LOV problem, all the nodes should have error, why click some nodes are ok?
    Thanks !
    Jessica

    I don't think it is related only to the number of rows but also to the content of the rows. So, counting only the number of rows doesn't say anything about if it is going to work or not. My question: can't you filter those entries? Making a choice between 250 entries in a tabular form isn't a simple task. Using popup-key LOV instead would also be a solution. However, if you use popup-key LOV be aware of the fact that you need two index numbers for those.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

Maybe you are looking for