Extracting BLOB from ORDImage

Hi
I need to extract the BLOB from an ORDImage object and store it in the same table (for use in an APEX report).
I've managed to accomplish this but can't understand why another simpler (to me anyway) approach fails.
CREATE TABLE ORDImage_images
(image_id   NUMBER PRIMARY KEY,
filename   VARCHAR2(20),
image      ORDSYS.ORDImage,
thumbnail  ORDSYS.ORDIMAGE,
blob_thumb BLOB);
-- load the image and confirm the image is loaded and thumbnail and blob_thumb columns are null
-- try to extract the BLOB
DECLARE
  l_image_id INTEGER:= 1;
  l_orig     ORDSYS.ORDImage;
  l_thumb    ORDSYS.ORDImage;
BEGIN
  -- lock row
  SELECT image
  INTO l_orig
  FROM ORDImage_images
  WHERE image_id = l_image_id FOR UPDATE;
  -- clear thumbnail and blob_thumb columns just in case
  UPDATE ORDImage_images
  SET thumbnail = null, blob_thumb = null
  WHERE image_id = l_image_id;
  -- this doesn't work
  l_thumb := ORDSYS.ORDImage.Init();
  -- but this does
  UPDATE ORDImage_images
  SET thumbnail = ORDSYS.ORDImage.Init()
  WHERE image_id = l_image_id;
  SELECT thumbnail
  INTO l_thumb
  FROM ORDImage_images
  WHERE image_id = l_image_id;
  l_orig.processCopy('maxScale=128 128',l_thumb);
  UPDATE ORDImage_images
  SET blob_thumb = l_thumb.source.localdata
  WHERE image_id = l_image_id;
  COMMIT;
END;I get the following error:
ORA-29400: data cartridge error
IMG-00710: unable to write to destination image
ORA-22275: invalid LOB locator specified
ORA-06512: at "ORDSYS.ORDIMG_PKG", line 1074
ORA-06512: at "ORDSYS.ORDIMAGE", line 175
ORA-06512: at line 32
29400. 00000 -  "data cartridge error\n%s"
*Cause:    An error has occurred in a data cartridge external procedure.
           This message will be followed by a second message giving
           more details about the data cartridge error.
*Action:   See the data cartridge documentation
           for an explanation of the second error message.I can't see why I need to use the thumbnail column (which I don't have any other use for) to initialise the l_thumb local variable. Why doesn't
l_thumb := ORDSYS.ORDImage.Init();accomplish the same thing? Or am I missing something really obvious?
Thanks for any help
Brian
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE     11.2.0.3.0     Production
TNS for 64-bit Windows: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production

ORDSYS.ORDImage.Init() initializes the image object and provides a LOB locator to the BLOB field of the object.
When a LOB that is being initialized is a persistent LOB (a column in the table), the LOB locator points to a location where LOB content can be written to. So processCopy can write to the BLOB. This is what happens in your example that works.
When a LOB that is being initialized is not persistent (for example, is a variable in a PL/SQL program), then the LOB locator is not pointing to any location. A temporary LOB has to be created for this LOB locator.
For example,
l_thumb := ORDSYS.ORDImage.Init();
dbms_lob.createTemporary(l_thumb.source.localData, true);
-- processCopy
-- don't forget to free the space when done
dbms_lob.freeTemporary(l_thumb.source.localData);
Now you would not have to create a column just to be a destination for the processCopy.
You could also directly processCopy to the destination BLOB (blob_thumb in your example), using the relational interface for processCopy. This will avoid a copy from the local variable to the destination BLOB, and the overhead of creating and deleting the temporary lob.
blob_thumb := empty_blob(); -- to get the LOB locator
processCopy(l_orig.source.localData, 'maxscale=128x128',blob_thumb);
-- see http://docs.oracle.com/cd/E11882_01/appdev.112/e10776/ch_relatref.htm#g1116554 (processCopy for BLOBs) for details.
Finally, if you want to keep the thumbnail image in ORDImage and still use APEX, you could do that - specify to APEX the location of the BLOB in the ORDImage object (by referring to thumbnail.source.localData). Then you could work with image and thumbnail columns in your table, initialize both with ORDSYS.ORDImage.init(), and use processCopy for ORDImage objects.
Edited by: mannamal on Oct 17, 2012 2:32 PM

Similar Messages

  • (fileSystem::extract Blob From Local Path) after installing B.O. XI 3.1

    Hello,
    I've installed B.O. XI 3.1 client tool on a laptop, but when I try to run Designer, or Deski the following error occurs (REPOSITORY ERROR (fileSystem::extract Blob From Local Path) file not found) and the application quits.
    Anyone has an idea?

    Hi
    What operating system are you using on your laptop?
    I have a colleague having a similar problem using Windows Vista, whereas I am fine (using XP).
    Did you manage to resolve this issue? (And if so, how)
    regards, Lara

  • How to extract blob from a table and save it as  a file?

    Dear All
    i have table employee (emp_id number , emp_name varchar2(60) emp_image blob)
    1 - i want to extract the emp_image of every employee into a operating system folder c:\images
    2 - the file name should be emp_id.gif or emp_id.jpg
    How can i do that?
    Thanks a lot in advance for your co-operation
    Regards
    Mohamed Hammed

    I want to put an XML in a table's column using BLOBs.
    I tried the following ways:
    Created a table:
    CREATE TABLE lob_table (id NUMBER, doc BLOB);
    Created a directory:
    create or replace directory XML_DIR as '\app\granite\rnd';
    Created a PL/SQL procedure:
    CREATE OR REPLACE
    PROCEDURE BLOB_PROCEDURE AS
    src_lob BFILE := BFILENAME('XML_DIR', '1.xml');
    dest_lob BLOB;
    BEGIN
    DBMS_OUTPUT.PUT_LINE('1');
    INSERT INTO lob_table VALUES(1, EMPTY_BLOB())
    RETURNING doc INTO dest_lob;
    DBMS_OUTPUT.PUT_LINE('2');
    DBMS_LOB.OPEN(src_lob, DBMS_LOB.LOB_READONLY);
    DBMS_OUTPUT.PUT_LINE('3');
    DBMS_LOB.LoadFromFile( DEST_LOB => dest_lob,
    SRC_LOB => src_lob,
    AMOUNT => DBMS_LOB.GETLENGTH(src_lob) );
    DBMS_OUTPUT.PUT_LINE('Done');
    DBMS_LOB.CLOSE(src_lob);
    Exception
    when others then
    DBMS_OUTPUT.PUT_LINE('Exception');
    COMMIT;
    END BLOB_PROCEDURE;
    I am using Oracle SQL Developer.
    When I try to run the above procedure, it says:
    "Source does not have a runnable target."
    When I use Toad, the procedure executes properly, but there is no blob data in the table.
    Kindly help me in this regard.

  • Stored Procedure or function to extract Blob

    How can I extract Blob from Oracle to the way it was inserted in the db ? I tried using utl_raw but it gave me "Buffer too small"
    ERROR at line 1:
    ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual:
    236143, maximum: 2000)

    I am trying this but it's not working for some reason:
    create or replace function F(B BLOB)
    return clob is
    c clob;
    n number;
    begin
    if (b is null) then
    return null;
    end if;
    if (length(b)=0) then
    return empty_clob();
    end if;
    dbms_lob.createtemporary(c,true);
    n:=1;
    while (n+32767<=length(b)) loop
    dbms_lob.writeappend(c,32767,utl_raw.cast_to_varchar2(dbms_lob.substr(b,32767,n)));
    n:=n+32767;
    end loop;
    dbms_lob.writeappend(c,length(b)-n+1,utl_raw.cast_to_varchar2(dbms_lob.substr(b,length(b)-n+1,n)));
    return c;
    end;
    I get ORA-22921: length of input buffer is smaller than amount requested
    ORA-06512: at "SYS.DBMS_LOB", line 833
    ORA-06512: at "SYS.F", line 15

  • How extract properties from document saved in blob.

    I need extract all document properties from document (any file type) saved in blob.
    I've tried three ways...
    - I've tried using relational ORDDoc.getProperties() by example. But this method returned exception ORDSYS.ORDDOCEXCEPTIONS.DOC_PLUGIN_EXCEPTION for every blob.
    - I can extract some properties with ctxhx.exe and key Meta. But this method is very expensive: I have to 1)save blob to file, 2)convert binary file to html-file, and 3)extract properties from html <meta> and <title> tags.
    - I can extract all properties with COM Automation. But this way need to install a lot of applications for every document type. It's impossible.
    Has anybody did same task yearly? Help me oracle guru!

    ORDDOc getproperties will attempt to see if the media is a video, audio or image and set the appropriate properties.
    I am gussing you have a word style document or something like that?
    Can you tell me about your application adn what you are trying to do?
    Larry

  • Converter via trigger from blob to ordimage

    Hi i make trigger for convertion blob to ordimage but when i execute it i got errors what should i do to fix this ?
    create or replace
    TRIGGER obrazy.dodanie_id23233
    AFTER INSERT OR UPDATE ON fotki
    FOR EACH ROW
    BEGIN
    INSERT INTO FOTKIORD (FOTKAID1, FOTKA1)
         VALUES (:NEW.fotkaid, ORDSYS.SI_STILLIMAGE(:NEW.fotka));
    END;
    Warning: oci_execute(): ORA-29400: data cartridge error IMG-00701: unable to set the properties of an empty image ORA-06512: at "ORDSYS.ORDIMERRORCODES", line 75 ORA-06512: at "ORDSYS.ORDIMERRORCODES", line 65 ORA-06512: at "ORDSYS.ORDIMERRORCODES", line 29 ORA-06512: at "ORDSYS.ORDIMG_PKG", line 33 ORA-06512: at "ORDSYS.ORDIMAGE", line 945 ORA-06512: at "ORDSYS.SI_STILLIMAGE", line 58 ORA-06512: at "OBRAZY.DODANIE_ID23233", line 2 ORA-04088: error during execution of trigger 'OBRAZY.DODANIE_ID23233' in C:\Program Files (x86)\Zend\Apache2\htdocs\upload.php on line 45

    994229 wrote:
    I created trigger and it works fine but for si_stillimag i cant why ???? Works fine for me:
    SQL> select  *
      2    from  v$version
      3  /
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE    11.2.0.3.0      Production
    TNS for 64-bit Windows: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    SQL> create table fotki(
      2                     fotkaid number not null,
      3                     fotka blob,
      4                     constraint fotki_pk primary key(fotkaid)
      5                    )
      6  /
    Table created.
    SQL> create table fotkiord(
      2                        fotkaid1 number not null,
      3                        fotka ordsys.si_stillimage
      4                       )
      5    segment creation immediate
      6  /
    Table created.
    SQL> create or replace
      2    trigger fotki_aiur
      3      after insert
      4         or update
      5      on fotki
      6      for each row
      7      begin
      8          insert
      9            into fotkiord
    10            values(
    11                   :new.fotkaid,
    12                   case
    13                     when :new.fotka is null then null
    14                     when dbms_lob.compare(:new.fotka,empty_blob()) = 0 then null
    15                     else ordsys.si_stillimage(:new.fotka)
    16                   end
    17                  );
    18  end;
    19  /
    Trigger created.
    SQL> -- NULL fotka
    SQL> insert
      2    into fotki
      3    values(
      4           1,
      5           null
      6          )
      7  /
    1 row created.
    SQL> -- empty_blob() fotka
    SQL> insert
      2    into fotki
      3    values(
      4           2,
      5           null
      6          )
      7  /
    1 row created.
    SQL> -- actual image fotka
    SQL> DECLARE
      2      v_blob blob;
      3      v_bfile BFILE := BFILENAME('TEMP','HONDA CR-V.jpg');
      4  BEGIN
      5      DBMS_LOB.CREATETEMPORARY(v_blob,TRUE);
      6      DBMS_LOB.fileopen(v_bfile,DBMS_LOB.file_readonly);
      7      DBMS_LOB.LOADFROMFILE(v_blob,v_bfile,DBMS_LOB.GETLENGTH(v_bfile));
      8      DBMS_LOB.FILECLOSE(v_bfile);
      9      INSERT
    10        INTO FOTKI
    11        VALUES(3,v_blob);
    12      DBMS_LOB.FREETEMPORARY(v_blob);
    13  END;
    14  /
    PL/SQL procedure successfully completed.
    SQL> select  *
      2    from  fotki
      3  /
       FOTKAID
    FOTKA
             1
             2
             3
    FFD8FFE000104A46494600010101006000600000FFDB004300020101020101020202020202020203
    0503030303030604040305070607070706070708090B0908080A0807070A0D0A0A0B0C0C0C0C0709
       FOTKAID
    FOTKA
    SQL> select  *
      2    from  fotkiord
      3  /
      FOTKAID1
    FOTKA(CONTENT_SI(LOCALDATA, SRCTYPE, SRCLOCATION, SRCNAME, UPDATETIME, LOCAL), C
             1
             2
             3
    SI_STILLIMAGE(ORDSOURCE('FFD8FFE000104A46494600010101006000600000FFDB00430002010
    10201010202020202020202030503030303030604040305070607070706070708090B0908080A080
      FOTKAID1
    FOTKA(CONTENT_SI(LOCALDATA, SRCTYPE, SRCLOCATION, SRCNAME, UPDATETIME, LOCAL), C
    7070A0D0A0A0B0C0C0C0C0709', NULL, NULL, NULL, '05-MAY-13', 1), 126992, 'JFIF', 6
    48, 1152, 'image/jpeg', '24BITRGB', 'JPEG', NULL, NULL, NULL, NULL, NULL, NULL)
    SQL>SY.

  • Can we extract blob objects from sql database to a human readable format?

    Hi All,
    I have question How can we extract
    blob objects from Sql database to human readable format ?
    Blob includes Images, text and docs.
    Thanks 
    Moug
    Best Regards Moug

    One thing you can do if its sql 2012 or later is to load the blob data to FileTable created in database. Then you would be able to physically browse to directory it points and see all files in its native format.
    see this for more details
    http://visakhm.blogspot.in/2012/07/working-with-filetables-in-sql-2012.html
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Extract data from database tables and download in pdf and csv

    extract data from database tables and download in pdf and csv
    hi how can i re-write my old form procedure in adf java. the procedure used to extract data from diffirent table and dowload the data in pdf and csv.am not downloading image, i what to extract data from diffirent tables in my database and download that data in pdf and csv. i would like to write this in java adf.i just what direction am not asking anyone to do my work this is my learning curve
    the form code is
    function merge_header3 return varchar2 is
    begin
         return '~FACILITY DESCRIPTION~ACCOUNT NO~BRANCH CODE~BANK REF NO.~P/P/ AMOUNT~Postal Address 1~Postal Address 2~Box Postal Code~Dep. Date~Month~BANK NAME~BRANCH NAME~ACCOUNT TYPE~DESCRIPTION~OBJECTIVE DESCRIPTION';
    end;
    procedure download_file (i_pbat integer) is
      dir varchar2(80);
      file_name1 varchar2(80);
      file_name2 varchar2(80);
      appl_code varchar2(80);
      fil1 client_text_io.file_type;
      fil2 client_text_io.file_type;
      dat varchar2(1000);
      DATA VARCHAR2(1000);
      bvspro varchar2(100);
      ssch   varchar2(100);
      bvspro_total number(20,2);
      ssch_total   number(20,2);
      grand_total  number(20,2);
      cnt    integer;
      cursor pbat is
           select *
           from sms_payment_batches
           where id = i_pbat
      cursor pay  (pb_id integer) is
           select *
           from sms_payment_vw
           where pbat_id = pb_id
           order by subsidy ASC,programme,beneficiary_name
      cursor cgref (low varchar2) is
           select *
           from cg_ref_codes
           where rv_domain ='SMS'
           and rv_low_value = low
      success boolean;     
      begin  
           set_application_property(cursor_style,'busy');
           appl_code := sms_global.ref_code('SMS','APP_CODE','SMS',0);
        dir       := sms_global.ref_code('SMS','PAY_DIR','c:\sms\batch_payments',0);
             success := webutil_file.create_directory(dir);
         if webutil_file.file_is_directory(dir) then
             null;
    --         message ('directory exists');
        else
    --                  message ('create directory ');
             success := webutil_file.create_directory(dir);
    --         if success then        message ('directory exists');    end if;
        end if;     
        for c_pbat in pbat loop
             file_name1 := dir ||'\' || appl_code||c_pbat.batch_number||'-'||to_char(c_pbat.batch_dt,'yyyymmdd')||'pay.txt';
             file_name2 := dir ||'\' || appl_code||c_pbat.batch_number||'-'||to_char(c_pbat.batch_dt,'yyyymmdd')||'merge.txt';
    --message('create files ');
    --         fil1  := client_text_io.fopen (file_name1,'W');
    --         fil2  := client_text_io.fopen (file_name2,'W');
        fil1  := client_text_io.fopen (file_name1,'W','');
        fil2  := client_text_io.fopen (file_name2,'W','');
                   dat :=                       'FROM ACCOUNT NUMBER'
                                                                ||'~'||'FROM ACCOUNT DESCRIPTION'
                                                                ||'~'||'MY STATEMENT DESCRIPTION'
                                                                ||'~'||'BENEFICIARY ACCOUNT NUMBER'
                                                                ||'~'||'BENEFICIARY SUB ACCOUNT NUMBER'        
                                                                ||'~'||'BENEFICIARY BRANCH CODE'
                                                                ||'~'||'BENEFICIARY NAME'
                                                                ||'~'||'BENEFICIARY STATEMENT DESCRIPTION'
                                                                ||'~'||'AMOUNT';
             --     client_text_io.put_line(fil1,dat);
             bvspro:= null;
             ssch  := null;
             cnt := 0;     
             dat := '~'||lpad('~',16,'~');
             for c_pay in pay(c_pbat.id) loop
    --message('cpay loop ' || cnt);              
               if bvspro is null then
                     dat := lpad('~',16,'~');
                     dat := utility.put_field(1,c_pay.programme,dat,'~');     
               client_text_io.put_line(fil2,dat);
               dat := utility.put_field(1,c_pay.subsidy,dat,'~');
               client_text_io.put_line(fil2,dat);
               dat := merge_header3;
                     client_text_io.put_line(fil2,dat);
                     bvspro := c_pay.programme;
                     ssch := c_pay.subsidy;
                     grand_total := 0;
                     bvspro_total := 0;
                     ssch_total := 0;
               end if;
               if bvspro <> c_pay.programme then
                     dat := lpad('~',16,'~');
                     dat := utility.put_field(5,ssch_total,dat,'~');
                     dat := lpad('~',16,'~');
                     dat := utility.put_field(5,bvspro_total,dat,'~');
               dat := utility.put_field(1,'Total:' || bvspro,dat,'~');
                     client_text_io.put_line(fil2,dat);
                     dat := lpad('~',16,'~');
               client_text_io.put_line(fil2,dat);
                     dat := utility.put_field(1,c_pay.programme,dat,'~');     
               client_text_io.put_line(fil2,dat);
                     bvspro := c_pay.programme;
               dat := utility.put_field(1,c_pay.subsidy,dat,'~');
               client_text_io.put_line(fil2,dat);
               dat := merge_header3;
                     client_text_io.put_line(fil2,dat);
                     bvspro := c_pay.programme;
                     ssch := c_pay.subsidy;
                     bvspro_total := 0;
                     ssch_total := 0;
                     cnt :=0;
             end if;                           
               if ssch <> c_pay.subsidy then
                     dat := lpad('~',16,'~');
                     dat := utility.put_field(5,ssch_total,dat,'~');
                     dat := lpad('~',16,'~');
               client_text_io.put_line(fil2,dat);
               dat := utility.put_field(1,c_pay.subsidy,dat,'~');
               client_text_io.put_line(fil2,dat);
               dat := merge_header3;
                     client_text_io.put_line(fil2,dat);
                     ssch := c_pay.subsidy;
                     ssch_total := 0;
                     cnt :=0;
             end if;                           
            bvspro_total := bvspro_total + c_pay.amount;
            ssch_total   := ssch_total   + c_pay.amount;              
                  grand_total  := grand_total  + c_pay.amount;              
            cnt := cnt +1;
    --message('bfore write file 2 ' );              
            client_text_io.put_line(fil2
                                   ,cnt
                            ||'~'|| c_pay.beneficiary_name
                                                                ||'~'||c_pay.BENEFICIARY_ACCOUNT_NUMBER ||''            
                                                                ||'~'||c_pay.BRANCH_CODE             ||''           
                                                                ||'~'|| c_pay.BENEFICIARY_STATEMENT_DESC            
                                                                ||'~'|| c_pay.AMOUNT                                
                            ||'~'|| c_pay.address_line1
                            ||'~'|| c_pay.address_line2
                                                    ||'~'|| c_pay.postal_code
                                                    ||'~'|| TO_CHAR(c_pay.deposit_date,'DD-Mon-YYYY')
                                                    ||'~'|| c_pay.month
                                                    ||'~'|| c_pay.bank
                                                    ||'~'|| c_pay.bank_branch
                                                    ||'~'|| c_pay.account_type
                                                    ||'~'|| c_pay.subsidy
                                                    ||'~'|| c_pay.programme)
                  DATA :=                                  c_pay.FROM_ACCOUNT_NUMBER                   
                                                                ||'~'||c_pay.FROM_ACCOUNT_DESCR                    
                                                                ||'~'||c_pay.MY_STATEMENT_DESCR                    
                                                                ||'~'||c_pay.BENEFICIARY_ACCOUNT_NUMBER
                                                                ||'~'
                                                                ||'~'||c_pay.BRANCH_CODE            
                                                                ||'~'||c_pay.BENEFICIARY_NAME                      
                                                                ||'~'||c_pay.BENEFICIARY_STATEMENT_DESC            
                                                                ||'~'||c_pay.AMOUNT;                                
            DATA := REPLACE(DATA, ',' , ' ' );
            DATA := REPLACE(DATA, '~' , ',' );
    --message (cnt ||' ' || data);       
    --message('bfore write file 1 ' );              
                  client_text_io.put_line(fil1, data);
             end loop;
    --message ('end of write');         
                 dat := lpad('~',16,'~');
                 dat := utility.put_field(6,ssch_total,dat,'~');
                 dat := lpad('~',16,'~');
           dat := utility.put_field(1,'Total:' || bvspro,dat,'~');
                 dat := utility.put_field(5,bvspro_total,dat,'~');
              client_text_io.put_line(fil2,dat);
              dat := lpad('~',16,'~');
           client_text_io.put_line(fil2,dat);
           dat := utility.put_field(1,'Grand Total:' ,dat,'~');
                 dat := utility.put_field(5,grand_total,dat,'~');
              client_text_io.put_line(fil2,dat);
             -- close file
    for i in 1..50 loop  
           if substr(i,-1) = 0 then
                 message ('flush ' || i);
           end if;                 
                  client_text_io.put_line(fil1, lpad(' ',2000));
                  client_text_io.put_line(fil2, lpad(' ',2000));
                  client_text_io.put_line(fil1, lpad(' ',2000));
                  client_text_io.put_line(fil2, lpad(' ',2000));
    end loop;
             client_text_io.fclose(fil1);
             client_text_io.fclose(fil2);
        end loop;
       set_application_property(cursor_style,'default');
        exception
             when others then
                  message(sqlcode ||' ' ||sqlerrm);
       end download_file;    i try this but this code onlydownload image not data from database tables
        public void downloadImage(FacesContext facesContext, OutputStream outputStream)
            BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
            // get an ADF attributevalue from the ADF page definitions
            AttributeBinding attr = (AttributeBinding) bindings.getControlBinding("DocumentImage");
            if (attr == null)
                return;
            // the value is a BlobDomain data type
            BlobDomain blob = (BlobDomain) attr.getInputValue();
            try
            {   // copy the data from the BlobDomain to the output stream
                IOUtils.copy(blob.getInputStream(), outputStream);
                // cloase the blob to release the recources
                blob.closeInputStream();
                // flush the output stream
                outputStream.flush();
            catch (IOException e)
                // handle errors
                e.printStackTrace();
                FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, e.getMessage(), "");
                FacesContext.getCurrentInstance().addMessage(null, msg);
            }

    You should ask your forum in the ADF-forum.

  • Extracting documents from Sharepoint 2013 Content Database

    harepoint 2013 stores documents in the WSS_Content database in a table called DocStreams.
    Up until Sharepoint 2010, files where stored in a single row in a VarBinary column. Since Sharepoint 2013, files are stored in multiple rows using Shredded Blob storage.
    Does anyone know how I can piece together the files from the shredded storage in c#?
    I have found many exampled online to extract files from SharePoint 2010 and earlier but they only support a files content being stored in 1 row.

    Just wondering, can't you attach the database in a new site and access documents? As I know, in SharePoint 2013 they have changed architecture to manage versioning. In pre-SharePoint 2013 every individual versions was a duplicate copy of the  document
    - which would increase db size and would make it difficult to move documents in the cloud. So in SharePoint 2013 they use delta concept - where if you edit a document which creates a new version, the version is the delta (changes) to previous version.
    Thanks,
    Sohel Rana
    http://ranaictiu-technicalblog.blogspot.com

  • How to cast a BLOB to OrdImage

    Hi,
    How can I cast or convert a BLOB to OrdImage? For example,
    <import...>
    public class ConvertBlobToOrdImage {
    public static void main(String args[]) throws Exception {
    // Load the Oracle JDBC driver:
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    // Connect to the database:
    Connection conn =
    DriverManager.getConnection(<"Your database connection">);
    conn.setAutoCommit(false);
    // Create a Statement:
    Statement stmt = conn.createStatement();
    String query = "SELECT blob FROM image_t where image_id = 1";
    OracleResultSet rset = (OracleResultSet) stmt.executeQuery(query);
    rset.next();
    OrdImage imageProxy = (OrdImage) rset.getCustomDatum(1, OrdImage.getFactory()); // <-- java.lang.ClassCastException: oracle.sql.BLOB
    rset.close();
    int height = imageProxy.getHeight();
    int width = imageProxy.getWidth();
    System.out.println("Image Dimension: " + height + " x " + width);
    System.out.println("Image Mime Type: " + imageProxy.getMimeType());
    TIA,
    Henry

    xwindy wrote:
    Does anyone knows how to cast a HashMap to HashMap<String, Object>?
    the session.getAttribute return only a HashMapthere is no way to do this safely
    you can use this annotation to suppress unchecked warnings
    @SuppressWarnings("unchecked")

  • Retrieving BLOB from Oracle 8.1.7

    I am having problems trying to extract a BLOB from and oracle dbase
    I keep getting the same ERROR:
    java.sql.SQLException: ORA-00942: table or view does not exist
    ORA-06512: at "SYS.DBMS_LOB", line 492
    ORA-06512: at line 1
    The exception gets thrown on the folloiwng line
    InputStream blobStream = blob.getBinaryStream();Here's my code. Any ideas would be most useful
    public class testBlob
      public static void main(String args[])
        DatabaseRegistry dbaseRegistry = DatabaseRegistry.getInstance();
        Database ebbosDbase = dbaseRegistry.getDatabase("Test");
        Connection conn = null;
        try
          conn = ebbosDbase.getConnection();
          DatabaseMetaData dmeta = conn.getMetaData();
          OracleCallableStatement oracleStatement = (OracleCallableStatement)conn.prepareCall("begin email_dispatch_pkg.extract_email_templates( ? ); end;");
          oracleStatement.registerOutParameter(1, OracleTypes.CURSOR);
          oracleStatement.execute();
          ResultSet rst = oracleStatement.getCursor(1);
          ResultSetMetaData meta = rst.getMetaData();
          int columns = meta.getColumnCount();
          while(rst.next())
            for(int i=1; i <= columns ; i++)
              System.out.println("COLUMN NAME=" + meta.getColumnClassName(i));
              System.out.println("COLUMN TYPE=" + meta.getColumnTypeName(i));
            BLOB blob = ((OracleResultSet)rst).getBLOB(7);
            InputStream blobStream = blob.getBinaryStream();
            System.out.println("blob length : " + blob.length());
            FileOutputStream fileOutStream = new FileOutputStream("/home/mt04803/test.pdf");
            byte[] buffer = new byte[10];
            int nbytes = 0;
            while ((nbytes = blobStream.read(buffer))!= -1)
              fileOutStream.write(buffer,0,nbytes);
            fileOutStream.flush();
            fileOutStream.close();
            blobStream.close();
        catch(Exception e)
          e.printStackTrace();
        finally
          try
            ebbosDbase.close(conn);
          catch(Exception e)
            e.printStackTrace();
        System.exit(0);
    }

    I think the ORACLE Error says that the Table or View does not exists. So it is just that the table or procedure which u are executing is not visible to the User you are logging in as.

  • Unable to extract data from an AS/400 system.

    Hello experts.
    We are trying to extract data from an AS/400 system but not having any success until now.
    I´ll write down you the stepts that we have followed until now:
    1.- Create a DB Connect between both systems
    2.- Create a Source System from AS400 in the workbench under DB Connect Directory
    3.- Generate datasources from tebles specified in the schema of the connection
    break point -
    At this point, we had a problem with some tables with at least one fieldname containing character "Ñ".
    After asking some possible solutions to SAP, the told us this is not supported, as the system can´t have any object with character "Ñ", so the transfer structure was unable to activate with this fields in the datasource.
    --- end of brek point --
    4.- After those issues, we´ve decided to implement, in another schema, views from those tables which had the fieldnames with that character "Ñ", changing them to an "N".
    5.- We´ve created another source system with that schema, and user than can see that schema.
    6.- To be able to see those views, in transaction RSDBC, we had to deactivate the two checkboxes in the first window ( Choose tables and Choose views) .
    7.- Right afeter, we could generate correctly the datasources from this logical tables.
    8.- We have designed  the hole dataflow for this datasources and everithing went rigth.
    9.- But wen we tried to execute the infopackage to extract data from those logic tables, we cannot get any registers. Acctualy the charge remains yellow after the job have finished.
    Please, I would appreciate any help you could give us on this problem.
    Thank you very much
    Regards
    Joaquin

    I´d like ti add something to this thread, and maybe clarify a littel bit the question.
    The only way that the BW system recognizes those logical tables, through transaction RSDBC is checking out the two boxes on this transaction, "Select Tables" and "Select Views".
    I don´t know haw these logical tables have been created, bus does this mean that the are not neither tables or views as BW understand them.
    Please, if someone knows anythin about this, answer to this thread.
    Thank you very much.
    Joaquin Sobrido

  • Extracting Data from APO PP/DS to BW

    Hi Gurus,
    I'm trying to extract data from APO PP/DS (SCM 5.1) to BW (BI 7.0). I'm new to SCM and am not sure how the extraction from SCM to BI happens other than that we need to read data from LiveCache.
    The extractor we are interested are
    0APO_PPDS_RESCAPREQ_01
    0APO_PPDS_PROD_CUST_01
    0APO_PPDS_OPERATION_01
    0APO_PPDS_ORDER_01
    Pls kindly help me out with the procedure.
    Thanks in advance.

    Hi
    Have a look at the below urls..
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5f229690-0201-0010-84ba-9ee5a8958a05
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/4fe5d590-0201-0010-6c8d-ada86492cf11
    Re: APO to BW Design Question
    Re: APO BW Integration
    Hope it helps
    Thanks
    Teja

  • What key fields should i set in DSO extracting data from 2LIS_02_ITM

    hi experts
    i extract data from 2LIS_02_ITM into a DSO, i know the DSO isn't a must, becoz the 2LIS_02_ITM delta type is ABR, but i want to keep the info in change log.
    so, what the key fields should i set in the dso? just ebeln and ebelp is enough?
    hunger for ur advice and thanks a lot!

    If you extract ITM toa DSO you cannot maintain a log of every change....the data will come ....but when the data must be activated the reference of the ebelp ebeln will remain only a single record....if you want to maintain all the data you must create another field in extractor with you can difference all the changes for one single ebelp ebeln...
    Regards

  • When I extracting data from DSO to Cube by using DTP.

    When i am extracting data from DSO to Cube by using DTP.
    I am getting following erros.
    Data package processing terminated (Message no. RSBK229).
    Error in BW: error getting datapakid cob_pro (Message no. RS_EXCEPTION105).
    Error while extracting from source 0FC_DS08 (type DataStore) - (Message no. RSBK242).
    Data package processing terminated. (Message no. RSBK229).
    Data package 1 / 10/04/2011 15:49:56 / Status 'Processed with Errors'. (Message no. RSBK257).
    This is the brand new BI 7.3 system. Implementing the PSCD and TRM.
    I have used the standard business content objects in FI-CA (dunning history header, item,activities) and standard Datasource (0FC_DUN_HEADER ,0FC_DUN_ITEMS, 0FC_DUN_ACTIVITIES). I have extracted data till the DSO level . when I try to pull the data to info provider level(cube) using DTP . I am getting fallowing error.
    my observation: when ever I use the DSO as source to any target like another DSO or cube. its throwing same kind of error for any flow including simple Flat file .
    please suggest any one whether do I need to maintain basic settings since its a brand new BI 7.3.
    please help me out on this issue . I am not able to move forward .its very urgent

    hello
    Have you solved the problem ?  
    I have the same error...
    as you solve this error,
    can you help me please I have the same error
    yimi castro garcia
    [email protected]

Maybe you are looking for

  • How to set JAVA_HOME in solaris9

    hello all, Do some one give me some url's or information how to set JAVA_HOME, CLASSPATH and related environmental setting for SOLARIS 9 operating system. thanQ, Han.

  • Pop-up screen does not appear for inspection point- In-process inspection

    Hi, We havs set up inspection points( time-based) in the master recipe. In that inspection point , we have defined date,time and inspector name as 3 fields to be maintained , before the results recording can start for each characteristic. Even though

  • Lenovo G450 constant freeze

    Long post warning. So since 3 weeks ago when I'm on chrome I'd get a plug in fail, then my windows (everything bUT cursor) would freeze up for 10 minutes. I'd tried disabling and enabling various flashes on chrome but nothing fixed the problem. Since

  • Can i update quicktime without updating itunes?

    I want to update my quicktime but I don't know how to do it without updating my iTunes. When my sister updated the iTunes on her laptop, it wasn't able to recognize her iPod because the iPod was outdated. I have the same kind of iPod so I think that

  • Revert to a previous version of my book

    So I went into a book I recently (successfully) had printed, and I got a message about my 'current pick' not bering the pick of the stack or something -- I don't remember the wording because It's gone now. Anyway, all the photos in the book have been