Unexpected ' digital or the error value "when you use CAST COLLECT

I have a problem with string using CAST aggregation / COLLECT and function to_string described on various sites around the net, including AskTom and http://www.oracle-developer.net/display.php?id=306.

I get "digital or value error: character string buffer too small", but cannot see what limit I'm exceeding.

I implemented a simple test case to highlight this problem I pasted below.

The error does not come from the function to_string itself (otherwise, I expect that we would see "TO_STRING threw an exception" in the error message that is returned).

Popular thoughts,

Thank you, Andy

SQL*Plus: Release 10.1.0.4.2 - Production on Tue Jun 15 09:56:53 2010

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> CREATE TYPE table_of_varchar2 AS TABLE OF VARCHAR2(32000);
  2  /

Type created.

SQL> CREATE OR REPLACE FUNCTION to_string (
  2              nt_in IN   table_of_varchar2
  3      ,       delimiter_in    IN VARCHAR2 DEFAULT ',')
  4      RETURN VARCHAR2
  5      IS
  6          l_idx   PLS_INTEGER;
  7          l_str   VARCHAR2(32767);
  8          l_dlm   VARCHAR2(10);
  9
 10      BEGIN
 11
 12          l_idx := nt_in.FIRST;
 13          WHILE l_idx IS NOT NULL LOOP
 14              l_str := l_str || l_dlm || nt_in(l_idx);
 15              l_dlm := delimiter_in;
 16              l_idx := nt_in.NEXT(l_idx);
 17          END LOOP;
 18
 19          RETURN l_str;
 20      EXCEPTION
 21          WHEN OTHERS THEN
 22              raise_application_error(-20000
 23                                  ,   'TO_STRING raised an exception. '||
 24                                      'The reported error was: '||sqlerrm);
 25     END to_string;
 26  /

Function created.

SQL> DECLARE
  2      l_longstring varchar2(32000);
  3  BEGIN
  4      SELECT  to_string(CAST( COLLECT( substr(object_name,1,1) ) AS table_of_varchar2 ) )
  5      INTO    l_longstring
  6      FROM    all_objects
  7      WHERE   rownum < 2001;
  8
  9  EXCEPTION
 10      WHEN OTHERS THEN
 11          raise_application_error(-20001
 12                ,   'The anonymous block raised an exception: '||
 13                    sqlerrm||'. '||DBMS_UTILITY.format_error_backtrace);
 14  END;
 15  /

PL/SQL procedure successfully completed.

SQL> DECLARE
  2      l_longstring varchar2(32000);
  3  BEGIN
  4      SELECT  to_string(CAST( COLLECT( substr(object_name,1,1) ) AS table_of_varchar2 ) )
  5      INTO    l_longstring
  6      FROM    all_objects
  7      WHERE   rownum < 2002;
  8
  9  EXCEPTION
 10      WHEN OTHERS THEN
 11          raise_application_error(-20001
 12                ,   'The anonymous block raised an exception: '||
 13                    sqlerrm||'. '||DBMS_UTILITY.format_error_backtrace);
 14  END;
 15  /
DECLARE
*
ERROR at line 1:
ORA-20001: The anonymous block raised an exception: ORA-06502: PL/SQL: numeric
or value error: character string buffer too small
ORA-06512: at line 1. ORA-06512: at line 1
ORA-06512: at line 4
ORA-06512: at line 11

Hi André,.

You have reached the limit of VARCHAR2 in SQL, which is 4000. The concatenated string is much longer. You get an even more informative error message if you deposit 20 to 24 lines in the to_string function.

Kind regards
Rob.

Tags: Database

Similar Questions

  • "Driver not installed successfully", the error message when you use the new MP3 player.

    I recently bought a Sony Mp 3 (model NWZ-E384) Player.

    When I connect the USB I get an error message will appear in the lower right corner on the screen saying "driver not installed successfully.

    Why am I seeing this? Better yet, why am I this problem? My previous Sony Mp3 worked fine with Windows 7.

    Is there a round work to install the device driver on my PC?

    Thank you very much

    Ian

    Don't know if this helps Sony - https://ca.en.kb.sony.com/app/answers/detail/a_id/42390/c/65, 67/p/57784,59687,59925,80740 / (from their support pages for the NWZ-E384 - http://esupport.sony.com/CA/p/model-home.pl?mdl=NWZE384&template_id=1®ion_id=3&tab=howto#/howtoTab ).

  • The errors tab when you use a RadioButtonGroup

    Someone could please take a look at this code below and let me know if they have the same problem that I get?

    Tab through the elements on the screen works fine until a radio button is selected form one of the groups.  Then, the tab fails because it is framed, mysteriously.

    The elements of the screen created dynamically.

    Can any provide a solution to get the tab work, while still creating issues dynamically using actionscript?  Is there something I am doing wrong so that the implementation of the RadioButtonGroups?  Or what?  I feel a major fault accessibility with this, I don't have a solution, my client is not happy, so any help is appreciated massively!

    Main.MXML

    <?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
            xmlns:s="library://ns.adobe.com/flex/spark" 
            xmlns:mx="library://ns.adobe.com/flex/mx"
            applicationComplete="applicationCompleteHandler(event)"
            width="800" height="600">
      
     
     <fx:Script>
      <![CDATA[
       import mx.events.FlexEvent;
       import spark.components.RichEditableText; 
       
       protected function applicationCompleteHandler(event:FlexEvent):void
       {
        for (var i:int=1; i<=4; i++){
         var questionGroup:VGroup = new VGroup();
         _ac_01_act.addElement(questionGroup);
         
         var qu:RichEditableText = new RichEditableText();
         qu.selectable = true;
         qu.editable = false;
         qu.text = "This is some text";
         questionGroup.addElement(qu);
         
         var rb:ActivityRadioButtonGroup = new ActivityRadioButtonGroup();
         rb.id = "q"+i+"radioButtonGroup";
         questionGroup.addElement(rb);
         
        }
       }
      ]]>
     </fx:Script>
     
     
     <s:VGroup id="activityGroup" x="20" y="20">
      <s:VGroup id="activityContent" gap="40">
       <s:RichEditableText id="_ac_01_txt" name="_ac_01_txt" text="This is some introductory text" width="400" selectable="true" editable="false" paddingRight="5" paddingTop="5" paddingBottom="5" accessibilityName="text field"/>
       <s:VGroup id="_ac_01_act" width="900" gap="20"/>
      </s:VGroup>
     </s:VGroup>
     
     
     
    </s:WindowedApplication>
    
    
    

    ActivityRadioButtonGroup.mxml

    <?xml version="1.0" encoding="utf-8"?>
    <s:VGroup xmlns:fx="http://ns.adobe.com/mxml/2009" 
       xmlns:s="library://ns.adobe.com/flex/spark" 
       xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:local="*">
     
     
     <fx:Declarations>
      <s:RadioButtonGroup id="buttonGroup"/>
     </fx:Declarations>
     
     <s:RadioButton id="radio1" value="1" groupName="buttonGroup" />
     <s:RadioButton id="radio2" value="2" groupName="buttonGroup" />
     <s:RadioButton id="radio3" value="3" groupName="buttonGroup" />
     <s:RadioButton id="radio4" value="4" groupName="buttonGroup" />
     
    </s:VGroup>
    

    It looks like it might be a bug here, for example I expect this simple example works when using group instead of groupName:

    http://ns.Adobe.com/MXML/2009.

    xmlns:s = "library://ns.adobe.com/flex/spark".

    "xmlns:local =" * ">

    A workaround seems to be to define your RadioButtonGroup on demand and then move it in your ActivityRadioButtonGroup component, here is an example:

    http://ns.Adobe.com/MXML/2009.

    xmlns:s = "library://ns.adobe.com/flex/spark".

    "xmlns:local =" * ">

    Import spark.components.RadioButtonGroup;

    [Bindable] public var rbg:RadioButtonGroup;

    ]]>

    I filed a bug for this here: http://bugs.adobe.com/jira/browse/SDK-29378

  • You met the C00D10D1 error message when you use Windows Media Player

    Hello

    I have no sound through Windows Media Player and also a player from Youtube and BBCi.  I have the following error message, please notify :-)

    You met the C00D10D1 error message when you use Windows Media Player. The following information can help you resolve the problem.

    Codec is missing

    Windows Media Player cannot play the file (or can't play the part of the file either audio or video) because theMP3 - codec MPEG Layer III (55) is not installed on your computer.

    The missing codec may be available for download on the Internet. For more information about codecs, seeCodecs: frequently asked questions.

    Hello
     
     
    1. What is the file type or extension that you try to play?

    If you get a message stating that your computer is missing a codec, you are probably trying to play, burn, or sync a file that was compressed by using a codec that does not include Windows or the default player. You will need to download codecs.
    Player Windows Media for Windows XP supported Codecs
    http://support.Microsoft.com/kb/291948
     
    Package of Installation of codec
     
    See also:
    Windows Media Player C00D10D1 error: MP3 - MPEG Layer III (55)
    http://Windows.Microsoft.com/en-us/Windows7/C00D10D1-55
     
    Note: The above are published in the Windows 7 category, but they apply to Windows XP too.

    I hope this helps.

    Thank you, and in what concerns:
    Shekhar S - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.
    If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • Error occurs when you use SQL Server 2012 assessment vs window detail of the object in window 7 - KERNELBASE.dll exception 0xe0434352

    Hello

    Error occurs when you use SQL Server 2012 assessment vs window detail of the object in window 7.  I use the window of the object but the detail of the objects window arrives and immediately SQL Server stops with the error below and then opens again.  I didn't find any help with this specific error is but suspect there is a problem between SLQ Server 2012 et.NET Framework 4.  Unfortunately, I do not know what it takes in this regard.

    Thanks, Deb

    Event ID: 1000
    Task category: (100)
    Level: error
    Keywords: Classic
    User: n/a
    Computer: Deb - HP
    Description:
    Name of the failing application: Ssms.exe, version: 2011.110.3000.0, time stamp: 0x5081c1cd
    Name of the failed module: KERNELBASE.dll, version: 6.1.7601.18015, time stamp: 0x50b83c8a
    Exception code: 0xe0434352
    Offset: 0x0000c41f
    ID of the process failed: 0x13a8
    Start time of application vulnerabilities: 0x01ce609a6d3db991
    The failing application path: C:\tempSQLWOW\110\Tools\Binn\ManagementStudio\Ssms.exe
    Path of the failing module: C:\Windows\syswow64\KERNELBASE.dll
    Report ID: 1fb1cbfb-cc8e-11e2-b436-abd2bebb3f17

    Hi Claude,.

    The question you posted would be better suited in the TechNet Forums. I would recommend posting your query in the link below.

    http://social.technet.Microsoft.com/forums/en-us/category/SQLServer

    Good day!

    Answer please if you face concerns.

  • I just got the error message when you try to enter my I and Psalm I have paid for the monthly subscription for 3 months and still have not been able to use these software. they are already installed it just let me acess them?

    I just got the error meassage when you try to open both my I and PS I paid monthly payments for the composition and I have these two installed software. What can I do to work on it and why they give me this error message?

    Log, activation, or connection errors. CS5.5 and later versions

    Anything else, to be more precise. you have not provided information system nor told us, what really is the error message.

    Mylenium

  • CC of Dreamweaver generates one of the 3 error messages when you use find and replace on 8.1 Win 64 bit.

    CC of Dreamweaver generates one of the 3 error messages when you use find and replace is used more than twice in a row. "While executing onLoad in bc_afterSave.htm, the following JavaScript error occurred: at line 188 of file C:\Program Files (x 86) \Adobe|. Adobe DreamweaverCC | Configuration | Shared | ' BC\JS\bc_sites.js': out of memory.

    or

    When executing RunCommand in File_Save.htm, a JavaScript erroroccurred.

    or

    While exciting getDynamicContent inAdressURL.htm, an erroroccirred of Javascript.

    Any thought - I find myself CBWMS of closing and reopening. Will work for the other two find and replace once again before the popup of messaged\s error.

    Cough, cough, cough - 38 500 pages? !  Really?  It's a big site!

    I'm not surprised, that you are short of memory.  Try to limit your F & R records or select files rather than the entire Site.

    Nancy O.

  • Get the error message when you try to launch the 64-bit CC bridge.

    Get the error message when you try to launch Bridge from Photoshop CC 64 bit.  "Cannot complete order because the extension cannot be loaded."  Need of difficulty.  Thank you.

    Hey Adobe Bubba,

    Please uninstall the software, run the cleanup tool, reboot your machine and install again.

    Cleaning tool: http://www.adobe.com/support/contact/cscleanertool.html .

    Kind regards

    Romt Sinha

  • ORA-00902 error invalid data type when you use CAST in the PL/SQL Package

    I'm getting ORA - 00902 Datatype not valid error when you use cast in getEmpValues (see code below) method in the package I created.
    I don't know what is the cause of the error. Any help would be appreciated



    CREATE OR REPLACE PACKAGE TEST. TEST_PKG AS

    ARRAY TYPE MyTableType IS NUMBER;
    TYPE REF_CURSOR IS REF CURSOR;

    FUNCTION str2tbl (p_str IN VARCHAR2)
    RETURN myTableType;

    PROCEDURE getContactValues (p_ParameterString IN VARCHAR2, p_Cursor1 to REF_CURSOR);

    END TEST_PKG;



    CREATE OR REPLACE PACKAGE BODY TEST. TEST_PKG AS

    FUNCTION str2tbl (p_str IN VARCHAR2)
    RETURN myTableType
    AS
    l_str LONG default p_str | ',';
    l_n NUMBER;
    myTableType l_data: = myTabletype();

    BEGIN
    LOOP

    l_n: = INSTR (l_str, ",");
    WHEN the OUTPUT (nvl(l_n,0) = 0);
    l_data.extend;
    l_data (l_data.count): = ltrim (rtrim (substr(l_str,1,l_n-1)));
    l_str: = substr (l_str, l_n + 1);
    END LOOP;
    L_data return;
    END;

    /*
    p_ParameterString is a string of the form 3, 6, 8, 9'
    */

    PROCEDURE getEmpValues (p_ParameterString IN VARCHAR2, p_Cursor1 to REF_CURSOR)
    AS


    BEGIN


    OPEN FOR P_Cursor1

    SELECT *.
    FROM EMP

    WHERE EMP_ID IN (SELECT *)
    OF THE (SELECT CAST (TEST.) (TEST_PKG.str2tbl (p_ParameterString) as myTableType) double)

    );
    END getEmpValues;

    END TEST_PKG;

    ARRAY TYPE MyTableType IS NUMBER;

    This type must be created outside of the package as a SQL type if it must be used in a select statement.

  • Problem with the format of the values in the command prompt (when you use multiple values)

    Hi all

    I have problem with the format of the values in the command prompt when you use multiple values.

    Value is year (2009) and when I use it in the drop-down list that is formatted, all right, as 2009, but when I use several values I get number as 2009,00. I put in year column format number with 0 decimal places and save by default in the year column. Year is formatted well anywhere in the query, such as 2009. Why is - what happens at the command prompt when you choose multiple values in prompt dashboard?

    Thank you

    I think the YEAR Data Type could be defined DOUBLE RPD.

    Use the CAST function in the formula (fx) and the output from test.

    CAST (INT YEAR)

    Hope, it will help you.

  • C00D11C8 error message when you use Windows Media Player

    How to fix C00D11C8 error messages when you use Windows Media Player.

    I've recreated the error on another computer running the same level of the OS and SP but received a more explicit error message telling me to get the codex of GoToMeeting.

    I downloaded the GoToMeeting codex and the problem was solved.

  • Error codes when you use windows update 0 x 643

    Error codes when you use windows update

    Received error code 0 x 643 during the installation of update for Visual C ++ 2010 (KB2467173). What should I do?

    Hey Joe,

    You can check if this article helps.

    You receive error code 80070643 0 x or 0 x 643, code error when you use the Windows Update

  • WMP has encountered an error while fire-"you met an error message when you use Windows Media Player".

    Original title: WMP has encountered an error when burning.  Check that the burner is connected properly and that the disc is clean and not damaged.

    I'm getting the above error message.  I tried at least 4 different drives and they are not the first discs I used this pack. also, I burned 30 + drives prior to receiving this message. When I click on the button "help", he says "you have encountered an error message when you use Windows Media Player.  Additional information is not currently available for this error. »

    Hello

    Have you made changes on the computer before this problem?

    I suggest you try these methods and check the status of the issue.

    Method 1:

    Keep the computer in a clean boot and check the status of the issue. If everything works well after a clean boot, you can deduce that some third-party services are at the origin of the problem. Continue with the remaining steps to pin-point on the third party service. After find you the program that is causing the problem, you will have to perhaps to update or install a newer version of the program, if you rarely use that you should consider uninstalling the software.

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7

    http://support.Microsoft.com/kb/929135

    Note: Please go up to step 7 of the Kb to maintain the computer to a normal startup after you fix the problem

    Method 2:

    Open the troubleshooter in Windows Media Player settings, run and check the status of the issue.

    http://Windows.Microsoft.com/en-us/Windows7/open-the-Windows-Media-Player-settings-Troubleshooter

  • How can I disable the mouse pad when you use a mouse plug-and-play?

    How can I disable the mouse pad when you use a mouse plug-and-play? I tried to disable the driver, and nothing works.

    Hello

    Check with support of the manufacturer system, documentation online or forums that there is probably
    Shortcut keys that enable and disable the touchpad functions.

    Parameters for TouchPad located in the control panel - mouse (there may be several tabs with TouchPad entered)
    and some come with a utility that loads in the Notification area next to the clock in the bottom right.

    ==========================================

    If necessary: (make sure that you have restarted at least once, if the above did not work)

    Panel of configuration manager devices - mouse and pointing devices - Double click on the touchpad - the driver tab-
    Click on update driver (it comes may not do anything like MS is far behind the drivers of certification), now right CLICK
    on the TouchPad and UNINSTALL.

    Then go to the USB and UNINSTALL ALL controllers except the category itself (all in). RESET

    This will refresh the driver for the TouchPad and battery USB. This does not prevent the touchpad from working.

    The similar procedure on XP, Windows 7 and Vista is the same, except that we need to clear the specific device if present.
    http://support.Microsoft.com/kb/310575

    Then go to the system manufacturer's website and get the latest touchpad drivers.

    Download - SAVE - go to where you put it-click on - RUN AS ADMIN.

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle="" -="" mark="" twain="" said="" it="">

  • Pages automatically reformats to the correct size when you use Folio Builder or what I have to do format pages iPad, for example, in the placed InDesign document in place from the beginning?

    Pages automatically reformats to the correct size when you use Folio Builder or what I have to do format pages iPad, for example, in the placed InDesign document in place from the beginning?

    Transferred to DPS forum.

    You must configure the pages of appropriately for the target device. For iPad, it is 1024 x 768.

Maybe you are looking for