Error raised when concatenating to CLOB using implicit to_char conversion

Hi there,
Please consider the code below (Oracle 11.1.0.7.0):
DECLARE
  c CLOB;
BEGIN
  FOR i IN 1..10
  LOOP
    -- Please uncomment ONE of the lines below
    c := c ||  LPAD('x', 8000, 'z') || i; -- raises error ora-06502
    --c := c || (LPAD('x', 8000, 'z') || i);  -- works
    --c := c ||  LPAD('x', 8000, 'z') || to_char(i);  -- works
  END LOOP;
END;Ok, maybe making use of implicit type conversion is not the best thing to do, but just out of curiosity is there any explanation for this error to happen?
It seems that, when implicit conversion is involved without the aid of brackets, Oracle tries to convert the whole thing to varchar2 before concatenating it to the clob, raising the error.
Thanks
Luis

Hi,
Accordingly link below, I think this behavior can be explained
http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28370/datatypes.htm#CIHGBADF
Case 1
c := c ||  LPAD('x', 8000, 'z') || i
How it going
1. Evaluate expression  res1 = LPAD('x', 8000, 'z')
2. Next oracle must to evaluate  c||res1 where c is clob and res1 is varchar2
3. Oracle can and choose implicit conversation res1 to clob
4. Evaluate expression  res2 = c||to_clob(res1);  where res2 now is clob
5. Next oracle must to evaluate  res2||i where res2 is clob and i is number
6. Oracle can implicitly convert number only to varchar2 not to clob so he choose implicit conversation i to varchar2
6.1 Oracle implicitly try convert res2 to varchar2 and when res2 size more then 32627 then he raise error ORA-06502Case 2
c := c || (LPAD('x', 8000, 'z') || i)
How it going
1. Evaluate expression  res1 = LPAD('x', 8000, 'z')
2. Next oracle must to evaluate  res1||i where res1 is varchar2 and i is number
3. So he convert i to varchar2 and evaluate res2 = res1||to_char(i)
4. Next oracle must to evaluate  c||res2 where res2 is varchar2 and c is clob
5. So he convert res2 to clob and evaluate c||to_clob(res2)Case 3
c := c ||  LPAD('x', 8000, 'z') || to_char(i)
How it going
0. Evaluate res0 = to_char(i)
1. Evaluate expression  res1 = LPAD('x', 8000, 'z')
2. Next oracle must to evaluate  c||res1 where c is clob and res1 is varchar2
3. Oracle can and choose implicit conversation res1 to clob
4. Evaluate expression  res2 = c||to_clob(res1);  where res2 now is clob
5. Next oracle must to evaluate  res2||res0 where res2 is clob and res0 is varchar2
6. He evaluate  to_clob(res0)||res2

Similar Messages

  • I want to install lightroom previously installed on a macbook on a new macbook. I get an error message when I try to use the same serial number. How can I install lightroom on my new mac?

    i want to install lightroom previously installed on a macbook on a new macbook. I get an error message when I try to use the same serial number. How can I install lightroom on my new mac?

    Oliver,
    Are you getting activation errors? As Ned stated , it is easier to troubleshoot if we have the specific type of error and error detail that you are getting.
    Here is some help on activation if this is the issue:
    https://helpx.adobe.com/x-productkb/policy-pricing/activation-network-issues.html
    Pattie

  • I get an error message when I try to use share function on IPhoto. I get the triangle icon with an exclamation mark inside of it.

    I get an error message when I try to use the share function on iPhoto. When I try to share photos via email a triangle icon with an exclamation mark appears. Why can't I use share function?

    The ! turns up when iPhoto loses the connection between the thumbnail in the iPhoto Window and the file it represents.
    What version of iPhoto? Assuming 09 or later
    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Repair Database. If that doesn't help, then try again, this time using Rebuild Database.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. (In Library Manager it's the FIle -> Rebuild command)
    This will create an entirely new library. It will then copy (or try to) your photos and all the associated metadata and versions to this new Library, and arrange it as close as it can to what you had in the damaged Library. It does this based on information it finds in the iPhoto sharing mechanism - but that means that things not shared won't be there, so no slideshows, books or calendars, for instance - but it should get all your events, albums and keywords, faces and places back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. 
    Regards
    TD 

  • Error code when signing in to use face time; 3121-2138-7457 any ideas to the problem?

    I recieve and error code when signing in to use facetime (3121-2138-7457) any information regarding how to correct this error code would be appreciated?

    There is no official public documentation of that alert as far as I know.
    If you're trying to sign in to FaceTime, try to sign in to iMessage in the Messages application, or vice versa.
    Otherwise, do as the alert directs. According to reports, you won't be charged for the support call if you select "Apple ID"—not the hardware model—as the product you're asking about, and cite the "customer code" in the alert as the "validation code" when you speak to the Apple representative.

  • I cant get the itunes store to work , it has a error code when I try to use it, any idea why?

    I cannot get the itunes store to work, it has an error code when I try to use it, any ideas?

    What error code number are you getting, rodeo?

  • Error message when launching PowerPivot Window using Excel 2010

    I have installed the latest version of Powerpivot on several of our workstations.  Some of them are running the application just fine and some of them are getting an intermittent error message when trying to launch the PowerPivot Window.
    We are running Windows 7 ENT 32bit with Office 2010 32bit
    The error message given is : An operation that uses the database driver could not be completed.   If the driver is a Microsoft driver, make sure the drvier file isn't damaged, and if it is, reinstall the driver by re-installing Microsoft Query.  
    You can then try again and it will work.
    In fact the majority of the time this error message won't appear.
    The application has been removed and reinstalled.
    When I checked event viewer i'm finding this error which I think is related
    The description for Event ID 1 from source MSOLAP$LocalCube cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

    MSOLAP$LocalCube cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted.
    Hello,
    It's just a guess: Power Pivot uses the MSOLAP = "Microsoft OleDB Provider for OLAP" and maybe that Provider is damaged on the machine. You may try to reinstall the Provider, you can get the installer named "SQL_AS_OLEDB.msi" from
    Microsoft® SQL Server® 2012 SP2 Feature Pack  =>
    ENU\x86\SQL_AS_OLEDB.msi (for 32 bit)
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Very often I get a contact error message when I try to use my contact list to send an e mail. If I use internet exployer I don't have a problem, so it can't be a problem with aol.

    Very often I get a contact error message when I try to us my contact list to send an e mail. If I use internet exployer I don't have a problem, so it can't be a problem with aol..

    See this support article - https://support.mozilla.org/en-US/kb/change-program-used-open-email-links

  • I get this error message when I try to use or set up publish services... An internal error has occurred: ?:0: attempt to index field 'exportSettings' (a nil value)

    Can anyone help with this error message when trying to use publish services?  An internal error has occurred: ?:0: attempt to index field 'exportSettings' (a nil value)

    Can anyone help with this error message when trying to use publish services?  An internal error has occurred: ?:0: attempt to index field 'exportSettings' (a nil value)

  • Getting Error 2 when I try to use I Tunes

    Download I tunes and I get Error 2 when I click on it..

    See Troubleshooting issues with iTunes for Windows updates.
    Or, if you have essentially done that already without success, install 7-Zip (free), or a free trial of WinRAR, and use one of them to extract the contents of the iTunesSetup.exe or iTunesSetup64.exe installer file, then try installing AppleApplicationSupport.msi as a standalone component. Even if it won't install you may get a more useful error message as to why not.
    tt2

  • Error raised when using a CallBack function on a Richtextbox

    Hi,
    I am using a RichTextBox with a Callback VI attached to the Keypress event.  Everytime I cause the kepress event to go off I get the attached error.
    I have created a small project to demonstrate the issue, also attached.
    I'm running Labview 2009 but have seen the issue on other version as well.
    Any ideas on what is causing the error would be most useful.  Have not implemented the CallBack VI correctly or is there some other issue I need to be aware of?
    Thanks
    Attachments:
    Error message.png ‏24 KB
    RichTextBoxCallback.zip ‏23 KB

    Hello Ruffdi,
    In order to get your 8.5 code to work as intended, you should wire the RichTextBox reference to your User Parameter input on the Event Callback (see pic below), and you should see the "KeyPress Detected" appear on your front panel.
    Also, make sure you add a little delay in your while loop, and a Close Reference function at the end of your code right after the while loop, to close the reference you open with the RichTextBox.
    I hope this helps for now, as I cannot find a workaround to the issue we are seeing in LabVIEW 2009.
    Let me work on this slightly more and see what we can do.
    smercurio_fc, thank you kindly for all your help so far, it is much appreciated.
    Kind Regards,
    Michael S.
    Applications Engineer
    NI UK & Ireland

  • Error raised when attempting a promotion

    Description of Problem or Question:
    My company is endeavoring to begin using Business Objects reporting. As a part of this effort, we wish to use the LCM tool to control the migration of public report objects from our Development environment to our Production environment. We decided to test this using a reporting object based on a BeX query. I created the promotion job using LCM in the Development client and tested the promotion with good results. But when we tried the actual promotion, the system raises the following error.
    Promotion Status = Failure: com.businessobjects.lcm.utilities.LCMException:java.lang.NullPointerException
    Product\Version\Service Pack\Fixpack (if applicable):
    Business Objects XI3.1 SP3
    LCM 1.0
    Apache Tomcat 5.5.20
    Java 6.0.170
    Relevant Environment Information (OS & version, java or .net & version, DB & version):
    WIN Server 2003 Enterprise SP2
    Sporadic or Consistent (if applicable):
    Consistent
    What has already been tried (where have you searched for a solution to your question/problem):
    I looked on the web and found a comment about setting an explicit language in the Java settings on the Tomcat app server we use. The command line looks like so.
    -Duser.language=en
    I did this and restarted the Tomcat server with no effect.
    Edited by: Jon Russell on Jul 9, 2010 12:19 AM

    Hi Jon ... we are getting exactly the same error. We have a very similar environment. We just raised a ticket with SAP Help Desk as well. What did you have to do with the SAP folks to fix your environment? Thanks Scott

  • Error 101 when trying to download using the Adobe Download Assistant

    What the F__K, I reisntalled windows 7, second time the same **** happen at the end, I m using a Data plan which allow me to D/L 8 GB  max in one month , this happened thrice with me , this time i downloaded in my D Drive 22.7 GB of free space remaining after complete D/l , and in C Drive I ve 50 GB free space , Operating System is now Windows 8 Preview , Last two times it was on Windows 7 Ultimate, Stilll having the same Downloader is really a super slow SICK I ever experienced.. Kindly look into the matter and resolve the issue with genuine REASONS , as i already seen and read all the Forums and post regarding to this problem

    These are the errors coming while I'm trying to extract the CS6 , but these error wont come while extractice indicisuals set ups of Photoshop, Dreamweaver and Flash.. so  I think the problem is in CS 6 Setup, I already mentioned that I try all the thing that u have told about user permissions, I never change the permission in case while I am extracting PS, DW and Flash, so why I need to provide permission in CS 6 ??? although all permission are set to FULL CONTROL still unable to extract in any version of Windows, Also the problem is  when now I am trying to Download the file again from direct link this message is coming :
    Access Denied
    You don't have permission to access "http://trials2.adobe.com/AdobeProducts/FLBR/4_6/win32/FlashBuilder_4_6_LS10.exe?" on this server. 
    Reference #18.244b3917.1347607523.5b70ac7c
    Can some real Adobe professional help me out on this problem ??? Except Mr. Jeff A Wright , as I am sick of his useless solutions

  • Strange error message when I tried to use the "collaborate" function under "File"

    Has anyone else met this before? : I am trying to share my project with my team members. Tried File -> Collaborate and then try three options under it. Non e of them works. It asks for your Adobe ID in order to sign in and upload. However, every time I typed in my Adobe ID and password, it gave me strange error messages. The first time it says: User has not verified email address yet. I have been using this Adobe ID since 2008 or 2009 and of course I have verified my email address. But to make sure, I went back to my email box and search for emails about Adobe ID verification but I didn't find any (I never delete emails such as this).
    Then I tried to register a new Adobe ID. This time when I tried to singn in with the new Adobe ID, it will either say "Network may not be available" (which is not true because I am able to surf on the Internet at the same time), or it says "User has not accepted user condition/agreement".
    I feel so frustrated because I feel this is definitely not my mistake which caused the failure of log in.
    Hope someone can tell me what the reason is and how to fix it though.
    Thanks a lot.

    Hi Lilybiri,
    Thanks for your quick response. I followed your suggestion and verified my Adobe ID on acrobat.com.
    Now I can enter the collaborate function. However, everytime when I tried to send it to myself (for test purpose) I got another error message "You need to enter a valid emaill address". I saw someone else on this forum has met the same problem. Do you have any suggestion on what is the possible reason for this to happen?
    Again, thanks for the fast response. You have been helping me and other ppl so much.

  • Error 0x80300024 When Installing Windows 7 Using Bootcamp

    Hi.  I'm trying to install windows on my mac mini.  I have a 2010 mini server with dual 500gb hard drives.  I want to have one disc for apple and the other disc for windows.  When I try the install I get the windows error 0x80300024.  After some research I found a straightforward, but not easy solution.  It seems windows freaks out when it sees more than one physical hard drive.  Therefore the solution is to disconnect the cables for the other hard drive, install windows on the target drive, then reconnect the cables to the other drive.  I rather not tear open the mini and do this as it looks a little painful.  Anyone have a suggestion on how to get around this?  And yes, I know it's a windows issue but i figured there must be some mini users who've experienced this issue.
    Thanks.
    Craig

    Hi Graig,
    One possble solution here, with maybe alt key to boot your Windows installer instead of the c key...
    PrincessPeachJun 17, 2009, 06:48 PM
    I just installed it today (twice actually, after changing my mind about something) so I can tell you how to do it. What I did was completely ignore Boot Camp and used Disk Utility to format the intended Windows drive as FAT32/Master Boot Record. Then I just rebooted with C held down and the Windows 7 CD took care of the rest.
    I have a 2009 Mac Pro so all my drivers etc were on my OS disc. If you need to burn the drivers, by all means use Boot Camp just for that part
    I got a warning in Windows 7 that Boot Camp had issues with the RC but it has been rock solid so far.
    http://forums.macrumors.com/archive/index.php/t-722467.html

  • I get a Pre-execute error message when importing from Excel using the wizard.

    Hello, I get the following pre execute error message(see below) when I try to import a table from Excel when using the wizard. I wrote my own code in the edit window. i noticed after writing it that the data types did not appear changed in the mappings window.
    Can anyone explain what these errors mean and how they can be solved. Thank you.
    Operation stopped...
    - Initializing Data Flow Task (Success)
    - Initializing Connections (Success)
    - Setting SQL Command (Success)
    - Setting Source Connection (Success)
    - Setting Destination Connection (Success)
    - Validating (Success)
    Messages
    * Warning 0x80049304: Data Flow Task 1: Warning: Could not open global shared memory to communicate with performance DLL; data flow performance counters are not available.  To resolve, run this package as an administrator,
    or on the system's console.
    (SQL Server Import and Export Wizard)
    - Prepare for Execute (Success)
    - Pre-execute (Error)
    Messages
    * Error 0xc0202009: Data Flow Task 1: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
    An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 11.0"  Hresult: 0x80004005  Description: "Unspecified error".
    An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 11.0"  Hresult: 0x80004005  Description: "The metadata could not be determined because every code path results in
    an error; see previous errors for some of these.".
    An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 11.0"  Hresult: 0x80004005  Description: "Invalid object name 'dbo.PriceTable$'.".
    (SQL Server Import and Export Wizard)
    * Error 0xc0202040: Data Flow Task 1: Failed to open a fastload rowset for "[dbo].[PriceTable$]". Check that the object exists in the database.
    (SQL Server Import and Export Wizard)
    * Error 0xc004701a: Data Flow Task 1: Destination - PriceTable$ failed the pre-execute phase and returned error code 0xC0202040.
    (SQL Server Import and Export Wizard)
    * Information 0x4004300b: Data Flow Task 1: "Destination - PriceTable$" wrote 0 rows.
    (SQL Server Import and Export Wizard)
    - Executing (Success)
    - Copying to [dbo].[PriceTable$] (Stopped)
    - Post-execute (Stopped)
    frustrationmultiplied

    Hello,
    Are you willing to try other ways to do the same?
    http://www.excel-sql-server.com/excel-import-to-sql-server-using-linked-servers.htm
    http://support.microsoft.com/kb/321686 (Distributed queries)
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

Maybe you are looking for

  • Text box-different font sizes in one box

    Sorry. I am new to final cut. I am trying to put text but want the citation underneath to be much smaller. How do I do this?

  • Bluetooth audio out of synch with macbook video

    The bluetooth audio is out of synch with the video playing on on my macbook.  Does anyone know how to synch them up?

  • X3-02 Cant Upgrade Firmware.

    why i cant upgrade my X3-02 firmware , it ses there are no available update of your software   but my firmware version is 5.32. 

  • Generate DDL script tailoring

    I would like to know how to tailor the sql script generated by JDev (11.1.1.0.0) - offline database source). I've reversed engineered a schema and modified a number of tables (in 10g). I would now want to generate a complete "create script", but with

  • What's this thing called?

    I want to buy this "thing", but I've no idea what it's called! I've tried Googling any number of search terms, but no luck:) It's basically similar to a surge protector, but it retains a few minutes charge, so in the event of a power cut your compute