How to transfer data within blob column to server

Hi,
I have the following requirement where i have a table which has a blob column that holds the files that are attached to a page using front end. I need to fetch these files and import them to server. How do i go about in achieving this?
Any in\puts would be of great help.
Thanks In Advance.

876841 wrote:
Hi,
I have the following requirement where i have a table which has a blob column that holds the files that are attached to a page using front end. I need to fetch these files and import them to server. How do i go about in achieving this?
Any in\puts would be of great help.Well, if the blob data is stored in columns on the database then it already resides on the server. If you need to save that data as files on the server then it's just a case of writing out the data to a file in the appropriate directory location.
Example code... (untested)...
As sys user:
CREATE OR REPLACE DIRECTORY MY_FILES AS 'c:\myfiles';
GRANT READ,WRITE ON DIRECTORY MY_FILES TO myuser;As myuser:
DECLARE
   -- Data Variables
   v_blob             BLOB;
   v_data_length      NUMBER;
   -- Loop Control Variables
   v_offset           NUMBER := 1;
   v_chunk   CONSTANT NUMBER := 32767; -- maximum chunk size
   -- UTL_FILE variables
   fh                 UTL_FILE.file_type;
BEGIN
   v_blob := ... populate the blob variable here
   v_data_length := DBMS_LOB.getlength (v_blob);
   -- Open the file
   fh := UTL_FILE.fopen ('MY_FILES', 'myfile.dat', 'wb', v_chunk);
   LOOP
      -- Exit when our file offset is bigger than our file
      EXIT WHEN v_offset > v_data_length;
      -- Write the output chunk by chunk
      UTL_FILE.put_raw (fh, DBMS_LOB.SUBSTR (v_blob, v_chunk, v_offset), TRUE);
      -- Increment the offset by the amount written
      v_offset := v_offset + v_chunk;
   END LOOP;
   -- Close the file
   UTL_FILE.fclose (fh);
END;

Similar Messages

  • How to insert data in BLOB column??

    How to insert data in BLOB column.
    Create table BLOBTest (message BLOB)
    insert into blobtest
    (message)
    values
    ('I am loving it');
    gives error ORA-01465: invalid hex number.

    ('I am loving it');This is not considered Binary (BLOB) data. Are you sure you don't want a Character (CLOB) column?

  • How to insert  data into BLOB column  using sql

    Hi all,
    How to insert data into BLOB column directly using sql .
    create  table temp
      a blob,
      b clob);
    SQL> /
    Insert into temp  values ('32aasdasdsdasdasd4e32','adsfbsdkjf') ;
    ERROR at line 1:
    ORA-01465: invalid hex number
    Please help in this.Thanks,
    P Prakash

    see this
    How to store PDF file in BLOB column without using indirect datastore

  • How to transfer data from CHAR column to DATE column?

    I have a column with varchar2 data type contains data with format: dd/mm/yyyy hh24:mm:ss for example 24/11/2013 8:15:22
    I want to execute an update statement to put this data also in a date column how?
    Note: I'm using Oracle DB 10g

    BillyVerreynne wrote:
    The question you need to ask is why a date value is in a string data type?
    And the only (IMO) valid reason for that is when the presentation layer reads the value from a user's input as a string. But even in that case, the client/presentation layer should convert it to a date when binding the value, as date type, to the bind variable of the SQL (or PL/SQL) code executed.
    Dates as strings should only exist in the presentation layer.
    Well, given the OP's question/problem, it sounds like they may be in the process of trying to correct that bad design.
    On the other hand, they could simply be applying a band-aid and thereby be actually compounding the problem.
    It would be nice to get a clarification on this point from the OP.

  • How do I align data within a column?

    In the newly updated Numbers (Mac), I cannot find how to align data within a column.

    The justify data select the column by clicking the column header (the letter at the top of the column) then open the formatter (top right):
    then select the "Text" formatter and select the type of aligment you want:

  • How to transfer data from one client to another client

    Dear Experts,
    Please explain how to transfer data (Materials) from one client to another client?
    Thanks,
    Ajay Kumar

    Hi Ajay,
    Check any of below methods
    Refer thread http://scn.sap.com/thread/171981 where people use IDOCs for master data transfer.
    OR
    This is done by BASIS team, by client refresh or client copy. Check with your basis team for this and there is some predefined time when they plan this activity, and in most project they do it once in 3 months etc to get production environment in test system which helps to resolve issues of production by creating similar case in test system.
    Check below threads for more information
    http://sap.ittoolbox.com/groups/technical-functional/sap-basis/cleint-copy-vs-client-refresh-1377848
    http://basissap.blogspot.in/2008/05/what-is-client-copy.html
    OR
    You can download data from one client and upload in another through BDC or LSMW.
    Regards,
    Sharat

  • How  to transfer data from one system to another by datamart please give de

    how  to transfer data from one system to another by datamart please give details

    Hi Deba,
    Find the below SAP help doc which may help u...
    http://help.sap.com/saphelp_nw70/helpdata/en/12/43074208ae2a38e10000000a1550b0/frameset.htm
    Also find the below threads...
    Loading data from one cube to another cube.
    data copy from infocube to infocube in two different BW systems
    Delta when loading from ODS to ODS
    reg datamart
    Data mart flag
    Regards,
    KK.

  • How to transfer data in table control in bdc

    hi
    how to transfer data in table control in bdc . I need the theory regarding this
    bye

    Hi,
    just check in the forum , there is many threads available to ur questions.
    Table control in BDC
    http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
    You can even refer to these related threads
    bdc table control
    Re: table control in bdc
    table control in BDC
    Reward if helpful.
    Thanks
    Naveen khan

  • How to transfer data in change log table of dso to z-table using abap code

    Hi  can you please explain me how to transfer data in change log table of dso to z-table using abap code ,with out using Function module concept

    PROGRAM NAME:   ZBW_DELTA_TO_GSTAR                                 **
    report ZBW_DELTA_TO_GSTAR no standard page heading
                                     line-size 120
                                     line-count 75
                                     message-id ZBW_MSG_CLS.
    tables:   ZGIV_DLTA_EBV_BB,
              ZGIV_DLTA_EM2_BL,
              ZGIV_DLTA_EM2_BK.
    Selection Screen Definitions
    SELECTION-SCREEN: BEGIN OF BLOCK INNER WITH FRAME TITLE TEXT-001.
    SELECTION-SCREEN: SKIP 1.
    PARAMETERS:       EBVBB RADIOBUTTON GROUP ROLL,
                      EM2BL RADIOBUTTON GROUP ROLL,
                      EM2BK RADIOBUTTON GROUP ROLL.
    SELECTION-SCREEN: END OF BLOCK INNER.
    Data:  WS_UPDATE_FLAG  Type C,
           UCounter(9)      Type N,
           ICounter(9)      Type N.
    DATA:  T_ZGIV_DLTA_EBV_BB Type Standard Table of ZGIV_DLTA_EBV_BB,
           s_ZGIV_DLTA_EBV_BB LIKE line of T_ZGIV_DLTA_EBV_BB.
    DATA:  T_ZGIV_DLTA_EM2_BK Type Standard Table of ZGIV_DLTA_EM2_BK,
           s_ZGIV_DLTA_EM2_BK LIKE line of T_ZGIV_DLTA_EM2_BK.
    DATA:  T_ZGIV_DLTA_EM2_BL Type Standard Table of ZGIV_DLTA_EM2_BL,
           s_ZGIV_DLTA_EM2_BL LIKE line of T_ZGIV_DLTA_EM2_BL.
    Standard Internal Tables - Describe usage.
    data: begin of i_AEPSD_O0140 occurs 0.
            include structure /BIC/AEPSD_O0140.
    data: end of i_AEPSD_O0140.
    data: begin of i_AEPSD_O0240 occurs 0.
            include structure /BIC/AEPSD_O0240.
    data: end of i_AEPSD_O0240.
    data: begin of i_AEPSD_O0340 occurs 0.
            include structure /BIC/AEPSD_O0340.
    data: end of i_AEPSD_O0340.
    data: begin of i_GIV_DLTA_EBV_BB occurs 0.
            include structure ZGIV_DLTA_EBV_BB.
    data: end of i_GIV_DLTA_EBV_BB.
    data: begin of i_GIV_DLTA_EM2_BK occurs 0.
            include structure ZGIV_DLTA_EM2_BK.
    data: end of i_GIV_DLTA_EM2_BK.
    data: begin of i_GIV_DLTA_EM2_BL occurs 0.
            include structure ZGIV_DLTA_EM2_BL.
    data: end of i_GIV_DLTA_EM2_BL.
    Miscellaneous Program Variables and Constants.
    TOP-OF-PAGE
    top-of-page.
    START-OF-SELECTION
    start-of-selection.
      Clear: i_GIV_DLTA_EBV_BB,
             i_GIV_DLTA_EM2_BK,
             i_GIV_DLTA_EM2_BL,
             UCounter, ICounter.
      IF EBVBB = 'X'.
        PERFORM 100_EXTRACT_EBV_BB_DELTA_RECS.
      ELSEIF EM2BK = 'X'.
        PERFORM 100_EXTRACT_EM2_BK_DELTA_RECS.
      ELSE.
        PERFORM 100_EXTRACT_EM2_BL_DELTA_RECS.
      ENDIF.
    FORM 100_EXTRACT_EBV_BB_DELTA_RECS
    FORM 100_EXTRACT_EBV_BB_DELTA_RECS.
      Refresh:   i_AEPSD_O0140,
                 i_GIV_DLTA_EBV_BB.
      Clear:      UCounter, ICounter, s_ZGIV_DLTA_EBV_BB .
      Select * From /BIC/AEPSD_O0140
        Into TABLE i_AEPSD_O0140.
      IF SY-Subrc = 0.
        LOOP AT i_AEPSD_O0140.
          MOVE-CORRESPONDING i_AEPSD_O0140 TO s_ZGIV_DLTA_EBV_BB.
          MOVE SY-DATUM to s_ZGIV_DLTA_EBV_BB-create_dt.
          INSERT ZGIV_DLTA_EBV_BB FROM s_ZGIV_DLTA_EBV_BB.
          IF SY-Subrc = 0.
            ICounter = ICounter + 1.
          ELSE.
            UPDATE ZGIV_DLTA_EBV_BB FROM  s_ZGIV_DLTA_EBV_BB.
            IF SY-Subrc = 0.
              UCounter = UCounter + 1.
            ELSE.
              Message E067 with SY-DATUM ' ' SY-UZEIT ' '.
            ENDIF.
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    "100_EXTRACT_EBV_BB_DELTA_RECS
    FORM 100_EXTRACT_EM2_BK_DELTA_RECS
    FORM 100_EXTRACT_EM2_BK_DELTA_RECS.
    Refresh:   i_AEPSD_O0240,
               i_GIV_DLTA_EM2_BK.
      Clear:      UCounter, ICounter, s_ZGIV_DLTA_EM2_BK .
      Select * From /BIC/AEPSD_O0240
        Into TABLE i_AEPSD_O0240.
      IF SY-Subrc = 0.
        LOOP AT i_AEPSD_O0240.
          MOVE-CORRESPONDING i_AEPSD_O0240 TO s_ZGIV_DLTA_EM2_BK.
          MOVE SY-DATUM to s_ZGIV_DLTA_EM2_BK-create_dt.
            INSERT ZGIV_DLTA_EM2_BK FROM s_ZGIV_DLTA_EM2_BK.
          IF SY-Subrc = 0.
            ICounter = ICounter + 1.
          ELSE.
            UPDATE ZGIV_DLTA_EM2_BK FROM  s_ZGIV_DLTA_EM2_BK.
            IF SY-Subrc = 0.
              UCounter = UCounter + 1.
            ELSE.
              Message E067 with SY-DATUM ' ' SY-UZEIT ' '.
            ENDIF.
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    "100_EXTRACT_EM2_BK_DELTA_RECS
    FORM 100_EXTRACT_EM2_BL_DELTA_RECS
    FORM 100_EXTRACT_EM2_BL_DELTA_RECS.
    Refresh:   i_AEPSD_O0340,
               i_GIV_DLTA_EM2_BL.
      Clear:      UCounter, ICounter, s_ZGIV_DLTA_EM2_BL .
      Select * From /BIC/AEPSD_O0340
        Into TABLE i_AEPSD_O0340.
      IF SY-Subrc = 0.
        LOOP AT i_AEPSD_O0340.
          MOVE-CORRESPONDING i_AEPSD_O0340 TO s_ZGIV_DLTA_EM2_BL.
          MOVE SY-DATUM to s_ZGIV_DLTA_EM2_BL-create_dt.
            INSERT ZGIV_DLTA_EM2_BL FROM s_ZGIV_DLTA_EM2_BL.
          IF SY-Subrc = 0.
            ICounter = ICounter + 1.
          ELSE.
            UPDATE ZGIV_DLTA_EM2_BL FROM  s_ZGIV_DLTA_EM2_BL.
            IF SY-Subrc = 0.
              UCounter = UCounter + 1.
            ELSE.
              Message E067 with SY-DATUM ' ' SY-UZEIT ' '.
            ENDIF.
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    "100_EXTRACT_EM2_BL_DELTA_RECS
    END-OF-SELECTION
    end-of-selection.
      perform D1000_REPORT_DATA.
    D1000_REPORT_DATA
    form D1000_REPORT_DATA.
    *Display the title of the program
      write: /25 SY-TITLE.
      skip.
    Diaplay the details of the user and time
      write: /1 'Executed by', 15 SY-UNAME, 30 'Date',
      38 SY-DATUM, 53 'Time', 60 SY-UZEIT.
      skip 2.
      write: /  'Delta Records have been extracted  ',
             /   'Updates : ', UCounter,
             /   'Inserts : ', ICounter.
      skip.
      skip 3.
      write: /20 'End of the report'.
    endform.                                           "D1000_REPORT_DATA
    chgeck it out this also may hep you

  • How to transfer data from macbook pro to an external hard drive, im using (WD 1TB 3.0) ???. I cannot copy anything from my mac to it not a single file.

    how to transfer data from macbook pro to an external hard drive, im using (WD 1TB 3.0) ???. I cannot copy anything from my mac to it not a single file.

    ok - since you'll be sharing it with a PC - connect it to your windows pc - then format from there - instead of NTFS format - choose exFAT.
    or, you can read the link below on how to do it in dos mode.
    http://answers.microsoft.com/en-us/windows/forum/windows_7-files/how-can-i-forma t-external-drive-in-exfat-not-in/0f6bf19a-19d6-4470-ae05-53ddf26bb476?msgId=1860 eae3-3488-4eea-8326-f87b89d9851b
    once you've formatted it - you can now use it in both your macbook and windows computer.

  • How to transfer data from an account to a new account in the same mac

    How to transfer data from an account to a new account in the same mac (macbook)

    Search these forums for merge accounts and also peruse these:

  • How to transfer data using the clipboard

    Does anyone know how to transfer data (string) from the clipboard to labview?
    I am trying to write C++ code using win32 API using the calls, OpenClipboard, Getclipboard and CloseClipboard functions. The problem is LV crashes when there is a call to the library function. Perhaps I am going about this the wrong way.
    Any ideas are appreciated.

    Perhaps this approach will give you the answer. I wrote a VI that uses the Win32 API directly. It calls OpenClipboard with the calling VI's window handle, then calls GetClipboard with the GW_TEXT constant to get a memory block handle. I lock the memory block with GlobalLock so other applications can't mess with it. I next call lstrcopynA , initializing a arg1 as a C String with 256 bytes and using the memory block handle as arg2, with the length of arg1 minus one as arg3. Your clipboard text is in the string output. Now call GlobalUnlock and CloseClipboard and you're done!
    Attachments:
    getclipboarddata.llb ‏168 KB

  • Inserting String data to BLOB column

    Hi All
    I want to insert String data into BLOB column using DBAdapter - through database procedure.
    anybody can help?
    Regards
    Albin Issac

    I have used utl_raw.cast_to_raw('this is only a test')).But for bigger string I get the error as "string literal too long" do we have any similar function for longer string.
    Thanks,
    -R

  • How to insert into a blob column

    hello,
    i want to insert data ina blob column.
    table is like :
    create table test(id number(1), blolcolumn blob);
    now i want to insert the value as specified below in blobcolumn using a pl/sql block.
    can anyone help in doing this using a pl/sql block?
    value to insert: 0x8000000025CE9B0483A7ECDE8DA5EA20C681841A091BF453EF33D6F58B3F0B5A2B869F48EF2C4A1A383C00FCAA8783FC16AF6E4C9F621C6EE07C4DA9B99EB914B101E46E4BB3EDECA29242B06DD600DF2577740A5C46F3C1D937EA9D090361B1FAA40E52CC3062A1C69420802A8CC68D4F16E9717F323D335611FCBE31CB18242E67E98940000000B1372A26C661D84C565B82C4BB6FDC4B2302A58E19588F99B55F84AF31DCB950C38725A69766D7B8B651464BBC81474A2AD5ECB8F5330CECBB059C35AE725C11400000003E86D68CD30617E9912A6B685F463D06B33079920BB64EE2768564273E98E621FA2841E6CEDB5EDB17E804C810EB552AF24EC359F35B4C7A34331EFBEE71B5B5030000000100014000000023CAC269B0DB17C47B0697AECF2EA8959EAB7F87C6B9273D4C8909A15A714D1D09DFA3E7F42EE3B8345A404EEA569A86CE29C5B204AF71C29C2344500BA2989080000000941810D14BEA288632783B39A5F946E1E4174787BA39695E3DDAFB1B6306453EC968E078F970771CDD8F744409C906039B2D9424BC7EB9824E9F81F8F681CDF989403F586B86091EBF573F911E8E8285FA09B6DD996B0B28E49F64E107526597F82BD0423EA6AD55B17A85B97BAD5BD6839EE72BA5B6DE3DD9C4E21D2DF4EDF740000000C35077FBCCED395621944ECD545DA4D8F9B0109A91067A9EA81CA11C075A51686089AA705578B6428815C08BFAF57165064D97FBBCD2A67CA44B2E70CE4471F340000000C21BA30F306E87FB299AFE849F52E32FDD8D134CA463B5D82B758C96BD70A69A52E6162E10B024F14CC91CBA79D07734A893D101BE1ED2C01D43D01D1276D0ED

    I think it may give an opinion:
    SELECT to_blob( utl_raw.cast_to_raw('0x8000000025CE9B0483A7ECDE8DA5EA20C681841A091BF453EF33D6F58B3F0B5A2B869F48EF2C4A1A383C00FCAA8783FC16AF6E4C9F621C6EE07C4DA9B99EB914B101E46E4BB3EDECA29242B06DD600DF2577740A5C46F3C1D937EA9D090361B1FAA40E52CC3062A1C69420802A8CC68D4F16E9717F323D335611FCBE31CB18242E67E98940000000B1372A26C661D84C565B82C4BB6FDC4B2302A58E19588F99B55F84AF31DCB950C38725A69766D7B8B651464BBC81474A2AD5ECB8F5330CECBB059C35AE725C11400000003E86D68CD30617E9912A6B685F463D06B33079920BB64EE2768564273E98E621FA2841E6CEDB5EDB17E804C810EB552AF24EC359F35B4C7A34331EFBEE71B5B5030000000100014000000023CAC269B0DB17C47B0697AECF2EA8959EAB7F87C6B9273D4C8909A15A714D1D09DFA3E7F42EE3B8345A404EEA569A86CE29C5B204AF71C29C2344500BA2989080000000941810D14BEA288632783B39A5F946E1E4174787BA39695E3DDAFB1B6306453EC968E078F970771CDD8F744409C906039B2D9424BC7EB9824E9F81F8F681CDF989403F586B86091EBF573F911E8E8285FA09B6DD996B0B28E49F64E107526597F82BD0423EA6AD55B17A85B97BAD5BD6839EE72BA5B6DE3DD9C4E21D2DF4EDF740000000C35077FBCCED395621944ECD545DA4D8F9B0109A91067A9EA81CA11C075A51686089AA705578B6428815C08BFAF57165064D97FBBCD2A67CA44B2E70CE4471F340000000C21BA30F306E87FB299AFE849F52E32FDD8D134CA463B5D82B758C96BD70A69A52E6162E10B024F14CC91CBA79D07734A893D101BE1ED2C01D43D01D1276D0ED')) FROM dual

  • How to Select data using same column name from 3 remote database

    Hi,
    Can anyone help me on how to get data with same column names from 3 remote database and a single alias.
    Ex.
    SELECT *
    a.name, b.status, SUM(b.qty) qantity, MAX(b.date) date_as_of
    FROM
    *((table1@remotedatabase1, table1@remotedatabase2, table1@remotedatabase3)a,*
    *(table1@remotedatabase1, table1@remotedatabase2, table1@remotedatabase3)b)*
    WHERE b.dept = 'finance'
    AND a.position = 'admin'
    AND a.latest = 'Y' AND (b.status <> 'TRM') AND b.qty > 0;
    GROUP BY a.name, b.status ;
    NOTE: the bold statements is just an example of what I want to do but I always gets an error beacause of ambiguous columns.
    Thanks in advnce. :)
    Edited by: user12994685 on Jan 4, 2011 9:42 PM

    user12994685 wrote:
    Can anyone help me on how to get data with same column names from 3 remote database and a single alias.Invalid. This does not make sense and breaks all scope resolution rules. And whether this is in a single database, or uses tables across databases, is irrelevant.
    Each object must be uniquely identified. So you cannot do this:
    select * from (table1@remotedatabase1, table1@remotedatabase2, table1@remotedatabase3) a3 objects cannot share the same alias. Example:
    SQL> select * from (dual, dual) d;
    select * from (dual, dual) d
    ERROR at line 1:
    ORA-00907: missing right parenthesisYou need to combine the objects - using a join or union or similar. So it will need to be done as follows:
    SQL> select * from (select * from dual d1, dual d2) d;
    select * from (select * from dual d1, dual d2) d
    ERROR at line 1:
    ORA-00918: column ambiguously definedHowever, we need to have unique column names in a SQL projection - so the join of the tables need to project a unique set of columns. Thus:
    SQL> select * from (select d1.dummy as dummy1, d2.dummy as dummy2 from dual d1, dual d2) d;
    DUM DUM
    X   X
    SQL> I suggest that you look closely at what scope is and how it applies in the SQL language - and ignore whether the objects referenced are local or remote as it has no impact to fundamentals of scope resolution.

Maybe you are looking for