Unable to upload a .dat file from pl/sql

Hi,
I have written a stub in plsql to upload a data file. the DB version which I am using is 11g ( 11.1.0.7). The data file consists of 94000 rows.
Sys is able to upload only 8000 rows at a time. I tried to upload it from the DB server by Setting serverout param to off. I generated a log file for this and I get " -ORA-06502: PL/SQL: numeric or value error: character string buffer too small " error. Kindly help on this issue.Are there any param's in the DB which will restrict the data upload into table based on rows/blocks at a time ?
My code is as follows :
DECLARE
     f           UTL_FILE.file_type;
     l           VARCHAR2(30000);
     l_rec          tmp_bic%ROWTYPE;
     split          DBMS_SQL.number_table;
     val          VARCHAR2(4500);
     s          NUMBER;
     e          NUMBER;
BEGIN
     -- Pls look at some sample lines in the file (FI.Dat)
     -- The following lines are to split the line to fields. If the position is changing,
     -- you may need to change the below accordingly.
     split( split.COUNT + 1 ) := 4;
     split( split.COUNT + 1 ) := 15;
     split( split.COUNT + 1 ) := 120;
     split( split.COUNT + 1 ) := 190;
     split( split.COUNT + 1 ) := 225;
     split( split.COUNT + 1 ) := 289;
     split( split.COUNT + 1 ) := 324;
     split( split.COUNT + 1 ) := 359;
     split( split.COUNT + 1 ) := 394;
     split( split.COUNT + 1 ) := 464;
     split( split.COUNT + 1 ) := 569;
     split( split.COUNT + 1 ) := 639;
     split( split.COUNT + 1 ) := 674;
     split( split.COUNT + 1 ) := 779;
     delete tmp_bic;
     commit;
     -- If the file name or Path are different, the following line needs to be edited accordingly
     f := utl_file.fopen('/tmp','FI.dat','r',32767);
     BEGIN
          LOOP
               utl_file.get_line(f,l);
               l_rec := NULL;               
               FOR i IN split.FIRST .. split.LAST
               LOOP
                    IF i = split.FIRST
                    THEN
                         s := 1;
                    ELSE
                         s := split(i-1);
                    END IF;
                    IF i = split.LAST
                    THEN
                         e := 500;
                    ELSE
                         e := split(i)-1;
                    END IF;
                    val := SUBSTR(l,s,(e-s+1));
                    val := LTRIM(RTRIM(val));
                    --dbms_output.put_line(i||' - '||s||' - '||e);                    
                    IF i = 1     THEN     l_rec.col1 := val;                    
                    ELSIF i=2     THEN     l_rec.col2 := val;
                    ELSIF i=3     THEN     l_rec.col3 := val;
                    ELSIF i=4     THEN     l_rec.col4 := val;
                    ELSIF i=5     THEN     l_rec.col5 := val;
                    ELSIF i=6     THEN     l_rec.col6 := val;
                    ELSIF i=7     THEN     l_rec.col7 := val;
                    ELSIF i=8     THEN     l_rec.col8 := val;
                    ELSIF i=9     THEN     l_rec.col9 := val;
                    ELSIF i=10     THEN     l_rec.col10 := val;
                    ELSIF i=11     THEN     l_rec.col11 := val;
                    ELSIF i=12     THEN     l_rec.col12 := val;
                    ELSIF i=13     THEN     l_rec.col13 := val;
                    ELSIF i=14     THEN     l_rec.col14 := val;
                    ELSIF i=15     THEN     l_rec.col15 := val;
                    END IF;
               END LOOP;
               INSERT INTO tmp_bic VALUES l_rec;
               commit;
               --exit;
          END LOOP;
     EXCEPTION
          WHEN NO_DATA_FOUND
          THEN
               NULL;
     END;
     utl_file.fclose(f);
EXCEPTION
     WHEN OTHERS
     THEN
          DBMS_OUTPUT.put_line('Error '||SQLERRM);          
          IF utl_file.is_open(f)
          THEN
               utl_file.fclose(f);
          END IF;
END;
insert into glo_bic_bkp select a.*,sysdate from glo_bic a;
commit;
BEGIN
     for i IN (
          SELECT     rowid rid,
               bic_code
          FROM      glo_bic          
     loop
          for j IN
               select substr(col3,1,35) name,
               substr(col4,1,35) addr1,
               substr(col5,1,35) addr2,
               substr(col8||' '||col9,1,35) addr3
               from tmp_bic
               where col2 = i.bic_code
          loop
               update     glo_bic
               set     name = j.name,
                    address1 = j.addr1,
                    address2 = j.addr2,
                    address3 = j.addr3,
                    mod_no = mod_no+1,                    
               WHERE     rowid = i.rid;
               commit;
          end loop;
     end loop;
END;
insert into glo_bic
     BIC_CODE,
NAME,
     CUSTOMER_NO,
     SK_ARRANGEMENT,     
     ADDRESS1,
     ADDRESS2,
     ADDRESS3,
     UPLOAD_FLAG,
     UPLOAD_UPDATE     
select     col2,
     substr(col3,1,35),
     null,
     'N',
     1,          
     substr(col4,1,35),
     substr(col5,1,35),substr(col8||' '||col9,1,35),
     'N',
     null     
from     tmp_bic
where      not exists (select 1 from glo_bic where bic_code = col2)
commit;
Edited by: tyro_vins on Sep 24, 2009 10:34 PM

The error sounds like one of the fields to too big for the column. Maybe you can look at the data in a text editor.

Similar Messages

  • Unable to delete data files from my Ipod if used as data storage...

    Hello everybody
    I bought months ago an Ipod Nano 8GB. I've got an issue when i use it as disk storage i'm not able to sort out. I've checked all the topics but i cannot find any solution.
    Example: I use the Ipod with the option "Manually manage music and videos". I put audio and video files on my Ipod through Itunes, then i put also some files on my Ipod as normal data files through my Mac Finder (Easy, i drag VLC, JPG files etc. from folders to my Ipod). The Ipod/Itunes summary page shows (Correctly) the capacity column colored in blue (Audio), video (Purple) and orange (Data). No probs when i transfer data files to another computer.
    Problem: when i delete the data files from my Ipod (Through finder) the orange column doesn't disappear (I have no problems if i delete audio/video files via Itunes) and although i've actually deleted all the files if i try to add some other data or videos/music files to my Ipod, Itunes says that there is no space available in my device. It's very strange, i check and double check all the options but eventually i have to restore my Ipod all the times and (Pretty annoying) add all my files again.
    It seems that although i sent my files to the trash bin, Itunes (Fully updated) doesn't recognize the change.
    It'd be great if someone can help me out as it's very important for me to be able to use my Ipod as disk storage, thanks a lot!

    It seems that although i sent my files to the trash bin, Itunes (Fully updated) doesn't recognize the change.
    Empty it from the Finder menu or by control-clicking it in the Dock.
    (44613)

  • How to upload Unicode encoding files from web?

    Hi everyone,
    I do not manage to upload Unicode encoding CSV files from web. Currently I use class CL_HTMLB_MANAGER to upload file from web. It works fine with ANSI encoding files, but file content is not uploaded correctly with Unicode encoding files. Especially I get innumerable characters u201C#u201D throughout the string that contains the file content (For example instead of u201CSAP CATALOG CSV 2.0u201D I get u201CÿþS#A#P# #C#A#T#A#L#O#G# #C#S#V# #2#.#0#u201D).
    I did not find in forums a solution to my issue that is why I am now asking for your help.
    How can I upload Unicode encoding files from web? Do you know another way to upload file from web that is Unicode compatible?
    Remark: I tried to upload Unicode encoding files from SAP GUI using function module GUI_UPLOAD and upload is successful.
    Here is the code that I currently used.
    DATA:     lr_event_ex     TYPE REF TO if_htmlb_data,
               fileupload      TYPE REF TO cl_htmlb_fileupload,
               lr_upload_model TYPE REF TO /ccm/cl_bsp_upload_model,
               lr_error        TYPE REF TO /ccm/cx_file_upload.
    lr_event_ex =  cl_htmlb_manager=>get_event_ex( runtime->server->request ).
    IF lr_event_ex->event_name = 'fileUpload' AND lr_event_ex->event_type = 'upload'.
      fileupload ?= lr_event_ex.
      FREE lr_event_ex.
    * get the model
      lr_upload_model ?= me->get_model( model_id = 'mupl' ).
      IF NOT fileupload->file_name IS INITIAL.
    *   upload data
        TRY.
            CALL METHOD lr_upload_model->upload_data
              EXPORTING
                iv_file_name = fileupload->file_name
              CHANGING
                cv_xcontent  = fileupload->file_content.
          CATCH /ccm/cx_file_upload INTO lr_error.
        ENDTRY.
        FREE fileupload.
      ENDIF.
    ENDIF.
    Thank you in advance for helping me.
    Best regards,
    Vanessa

    Hi There,
    Please check the details for the same.
    Link: http://helpx.adobe.com/creative-cloud/help/sync-files.html#Sync or upload files
    Troubleshoot sync:     
    Error: "Unable to sync files"
    Creative Cloud File Sync | Known issues
    Thanks,
    Atul Saini

  • How to upload a text file from a shared folder and provide an o/p

    how to upload a text file from a shared folder and provide an o/p  containing the details in each order in the text file

    Hi,
    Use <b>GUI_UPLOAD</b> to upload a text file from a shared folder.
    Use <b>GUI_DOWNLOAD</b> to download data in a file on the presentation server or use <b>OPEN DATASET, TRANSFER</b> and <b>CLOSE DATASET</b> statements to download data to the application server.
    Now, I hope the code for data fetching, if required, is already present in the report.
    Reward points if the answer is helpful.
    Regards,
    Mukul

  • How do i move a data file from my pc to my ipad

    How do I move a data file from my computer to my ipad? It is my product catalogue and it would help if it were on my ipad.

    Plug the iPad into iTunes and you can use file sharing to move it into an app that supports file sharing and that document format.
    see http://support.apple.com/kb/ht4094
    Or, use an online storage service (iCloud, dropbox, box, google drive, sugarsync, etc) and upload the file to that.  Then on the iPad, from within the app you plan to use the file with, link to that service and download the file.
    The app will again have to work with that file type, and support the particular service you used.

  • 'No Upload Authorization' While Uploading a Text File from Multiple Select

    Hi all,
       The User is trying to upload a text file from Multiple Selection screen of a Query in BEx and it gives the error message of 'No Upload Authorization' (Error DB886).
       In 'Logon data' tab of Tcode SU01, it has 'User' for 'User Group for Authorization check' for this User.
       I could upload a text file from Multiple Selection screen with my User Id.
       An idea about this error, PLEASE ?
    Thanks,
    Venkat.

    Hi Ron,
       This User does not have the access to Tcode ST01.
       The user executed Tcode SU53 immediately following the authorization failure to see the authorization objects. The 'Authorization obj' is blank and under the Description it has 'The last Authorization check was successful' with green tick mark.
      Any further suggestions, PLEASE.
    Thanks.

  • After uploading an excel file from Windows XP, impossible to read the file anymore

    Hello,
    I uploaded an excel file from my Imac to the Icloud. I could use it on my Ipad through Numbers without problem. I went on my laptop running with Windows XP, I didn't see the plugin to install, so I didn't do it. I download this excel file and worked on it. When I uploaded again this file, I could see the letter E written on the file on the Icloud, but impossible to download it and work on it anymore from any of my devices. I installed the missing plugin on the laptop but still, no improvements.
    Any suggestions ?
    Best regards.

    Hi Stephan,
    You can do this using OLE technology. Bu you will have performance issues.
    Can you check the below demo programs? It has similar functionality. I am able to create excel sheet from sap and also able to save the data in the sap.
    SAPRDEMOEXCELINTEGRATION
    SAPRDEMOEXCELINTEGRATION2
    Please also check the below rograms for more help.
    SAPRDEMOACTIVEXINTEGRATION
    SAPRDEMODOCUMENTCONTAINER
    SAPRDEMODOCUMENTCONTAINER2
    Thanks
    Ramakrishna

  • Uploading and downloading files from a web app (Urgent!!)

    Hi everyone:
    I'm developing an application in PL/SQL to upload and download files from an HTML webpage. I congured the document table and the parameters necessary in the DAD of my application.
    when I upload the file using my webpage that file info is automatically uploaded to the doc table. This is as far as I have gotten.
    I need to do the following:
    - Place the uploaded file into a column in another table in my database as part of a text message (think of it as an email message), and delete the file from the doc table (as this is thought to be a temp table that holds the file when uploaded from my webpage)
    - Retreive the file so that it can be downloaded from another web page.
    The file can be a PDF, WORD DOC, etc...
    I now that I can do this with InterMedia but I haven't figured out how :(
    Can anyone please point me to an example or some documentation that can guide me through the process.
    DB VERSION: 8.1.7
    IAS VERSION: 1.0.2.2
    Thanks,
    Carlos Abarca

    The idea was for you to look at the code and get an idea of how to access the BLOB in the document table. IF you look at the procedure
    insert_new_photo( new_description IN VARCHAR2,
    new_location IN VARCHAR,
    new_photo IN VARCHAR2 )
    It shows how to access the blob that is stored in the document table. You can then copy this blob to your own table using the DBMS_LOB package.
    Hope this helps,
    Larry

  • Unable to pick up the file from Receive Location

    BizTalk is  unable to pick up the files from receive location.
    My admin console is working so slow.
    It is showing the problem of snap-in as follows:
    I have checked all my receive location and its masking,it is working fine.
    Actually it is working fine in dev server(snap-in problem is not occuring in dev server ) but when I import MSI and binding in UAT server.
    It is not picking up the file from receive location.
    I want to know one more thing :if my message box database is not working fine,will it receive the files from receive location.
    Prakash

    For files not received by receive location. If the Receive Location is still enabled but files are not processed by Receive Location, then check whether the host instance  configured with your receive location is running. If the host instance is in
    running state, restart the host instance and try.
    Regarding the error in the admin console as shown in the image, people started to see this issue with admin console from BizTalk 2009 onwards. This happens in cases like you have done some activity with console and before its been refreshed it you do more
    activities like expanding the node you will see this error. Sometimes WMI is bit slowly to refresh your admin console screen. Just wait for few seconds untill the WMI screen is rendered completely. Ensure you have all the cumulative updates installed for your
    version of BizTalk and also ensure the service pack for your OS is updated.
    Obviously if message box is not working, files will not be received/processed. But if message box is not in healthy state this would affect all other application not just one and in-fact it would affect entire BizTalk not just Receive Locations.
    To start analysing this file not been processed by Receive Location, start with checking the host instance as mentioned.
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • I am having some huge problems with my colorspace settings. Every time I upload my raw files from my Canon 5D mark II or 6D the pics are perfect in color. That includes the back of my camera, the pic viewer on my macbook pro, and previews. They even look

    I am having some huge problems with my colorspace settings. Every time I upload my raw files from my Canon 5D mark II or 6D the pics are perfect in color. That includes the back of my camera, the pic viewer on my macbook pro, and previews. They even look normal when I first open them in photoshop. I will edit, save, and then realize once i've sent it to myself to test the color is WAY off. This only happens in photoshop. I've read some forums and have tried different things, but it seems to be making it worse. PLEASE HELP! Even viewing the saved image on the mac's pic viewer is way off once i've edited in photoshop. I am having to adjust all my colors by emailing myself to test. Its just getting ridiculous.

    Check the color space in camera raw, the options are in the link at the bottom of the dialog box. Then when saving make sure you save it to the srgb color space when sending to others. Not all programs understand color space and or will default to srgb. That won't necessarily mean it will be accurate, but it will put it in the ballpark. Using save for web will use the srgb color space.

  • When i try to upload a .mts file from my Sony camera to Premiere Pro CC it refuses to play the audio! Ofcourse i could convert every single clip but it takes tons of time. How can i make Pr play audio track properly?

    When i try to upload a .mts file from my Sony camera to Premiere Pro CC it refuses to play the audio! Ofcourse i could convert every single clip but it takes tons of time. How can i make Pr play audio track properly?

    Does it not play at all or cannot you get the audio in the timeline?
    Did you copy the entire card to the hdd and then imported the file via the Media Browser?
    Did you source patch the audio tracks?

  • "iTunes was unable to load class data information from sync services"

    I own iTunes 10.5 beta 3 64-bit for my 64-bit windows 7 pc, and it gives me this message whenever I try to sync ANY of my devices: "iTunes was unable to load class data information from Sync Services". I own an old iPod video and an iPhone 4 with iOS 5 beta 3. I've tried uninstalling all Apple products, searching through my hard drive and deleting everything Apple, cleaning the registry, EVERYTHING. I've reinstalled at least 4 times now. The problem refuses to become fixed. I've searched every article online possible, and none of the solutions have worked. Is there anything I can do to get my stuff back on to my devices???

    In the course of your troubleshooting to date, have you worked through the following document?
    iTunes for Windows: "Unable to load data class" or "Unable to load provider data" sync services alert

  • I am trying to upload my PDF file from my IBooks but its only giving me the option to upload from my pictures/gallery. How do I get it to where I can upload PDF files from my iBook or how do I transfer my PDF files to my pics?

    I am trying to upload my PDF file from my iBooks but its only giving me the option to upload from my pictures/gallery. How do I get it so I can upload from my iBooks or move my PDF files to my gallery so I can upload it?

    I'm having the same issue. I saved a PDF from an email into iBooks. I'm on apple applying for a job but the only option the upload button has is from the Photos file. How ironic right? Luckily I'm in Logistics and not an IT specialist applying for this job! Lol. Does anyone know the fix?

  • Uploading an XML file from SAP into third party URL

    Hi,
    I need to Upload an XML file from sap into Third party URL. Can any body tell me the possible ways in SAP to achieve this task. Also explain me the proceedure.
    Thanks in advance.
    -Namdev

    Sorry. If they only said HTTP/HTTPS and didn't say explicitly web service, it means they don't want it.
    One thing I'm not sure is, do you have an URL at the third-party system that you need to contact, or should you provide one at your SAP system that they will contact?
    If it is the first one, to send an HTTP request to a given URL using ABAP, you'll find an example here: [SAP Library: Example Program: Executing an HTTP Request|http://help.sap.com/saphelp_nw70/helpdata/en/1f/93163f9959a808e10000000a114084/frameset.htm]
    Sandra

  • Using Migration Assistant to Move Data Files from one Account to New User

    Is it possible or recommended to use Migration Assistant to move data files from an old user account to a new user account on the same volume/hard disk?

    Migration Assitant cannot be used as a simple file transfer utility. MA can transfer an entire Home folder or entire Users folder but not individual files.
    In general files in one user account cannot be moved to another user account as this would violate built-in security measures.
    What you can do is to copy the files to an external device like a hard drive or flash drive. First log in to the old account. Then configure the drive to ignore preferences by Pressing COMMAND-I to open the Get Info window and check the Ignore permissions on this volume checkbox at the bottom of the window. Copy your files to the device. Log into the new account. Verify the external drive is still configured to ignore permissions (reset it, if not.) Copy the files from the external device into the Home folder of the new account. I would create a temporary folder for these files. If you still end up without the proper permissions you will need to make modifications that are easier done if all the files are in a single folder.

Maybe you are looking for