Help abt store and delete images as blob & bfile using Visual C++

Hi
Does anyone knows if there is code for visual c++
to store and delete images as blob or bfile?
thanx

The documentation states there are examples in the oracle database distribution: <ORACLE_HOME>/rdbms/demo/cdemolb.c <ORACLE_HOME>/rdbms/demo/cdemolb2.c <ORACLE_HOME>/rdbms/demo/cdemolbs.c
These examples are in c, but can be used in c++
http://otn.oracle.com/doc/server.815/a67846/app_exam.htm#430289

Similar Messages

  • Want to store and retrived  images  in the BFILE format using inter media

    I want to store and retrived images in the BFILE format using inter media.I found a article in the oracle site that Oracle interMedia image supports BFILEs.But this article is not demonstrating the use of BFILEs.Please help me to findout the solution.
    Thanks in advance.
    null

    The advantage to using BFILE storage for your is that it's an easy way for Oracle
    Multimedia to access your images without importing them into the database.
    The disadvantages are that the images are read-only. If you want to scale an image or
    convert to a different format, you will need to create a destination image to hold the result. This
    will necessarily be a BLOB based image.
    Adding images is difficult to do from within an application program. Generally you would add new images to a file system that is accessible to the Oracle Database, then insert new rows in your table with appropriate BFILE pointers to the new images.
    BFILE images require separate backup from the database. Also there is not way to transactionally coordinate your BFILE data with your relational data.
    If you are using Oracle 11g, you can use the SecureFile option for BLOB storage. This is much faster then the previous BLOB storage (now called BasicFile) and much faster then BFILE also.
    That said, below is a code snippet that shows how to insert a BFILE based image, set it's properties, show it's properties and select the BFILE locator to access the content. You would need to use the DBMS_LOB package (in PL/SQL) to read the content. From other APIs, (e.g., Java) you would need to use the proper interfaces to access the BFILE.
    Note that you need change the USER, PASSWORD fields in the code. Also you should change the directory location and image name for your use.
    -- create a directory object indicating where the images are stored;
    create or replace directory imgdir as '/tmp';
    -- and grant permission to read to a user;
    grant read on directory imgdir to <USER>;
    conn <USER>/<PASSWORD>;
    -- create the images table
    create table images(id integer primary key, image ordsys.ordimage);
    set serveroutput on
    declare
    obj ordsys.ordimage;
    begin
    -- use the init('FILE', <SRC_LOCATION>, <SRC_FILE>) function
    -- to create an ORDIMAGE object with a BFILE source
    insert into images(id, image)
    values(1, ordimage.init('FILE', 'IMGDIR', 'wizard.jpg'))
    returning image into obj;
    -- lets see if the image source is local or not
    if(obj.isLocal()) then
    dbms_output.put_line('image source is local');
    else
    dbms_output.put_line('image source is NOT local');
    end if;
    -- set the properties of the image object
    obj.setProperties();
    -- and update the row
    update images set image=obj where id=1;
    commit;
    end;
    column height format 99999
    column width format 99999
    column mimetype format a30
    column length format 999999
    -- let's see what we have
    select t.image.getHeight() as "height"
    , t.image.getWidth() as "width"
    , t.image.getMimetype() as "mimetype"
    , t.image.getContentLength() as "length"
    from images t
    -- fetch a BFILE handle to the content
    declare
    bf BFILE;
    length number;
    begin
    select t.image.getBfile() into bf
    from images t
    where t.id=1;
    -- use the DBMS_LOB interface to find out size of image
    length := dbms_lob.getLength(bf);
    dbms_output.put_line('length of BFILE is ' || length);
    end;
    ---What we get when we run the code
    Connected.
    Directory created.
    Connected.
    Table created.
    image source is NOT local
    PL/SQL procedure successfully completed.
    height     width mimetype               length
    399     485 image/jpeg          92552
    length of BFILE is 92552
    PL/SQL procedure successfully completed.
    SQL>

  • How do I store and delete files on the iphone

    how do I store and delete files on the iphone

    Files/documents need to be stored/associated within an app on the iPad, unlike 'normal' computers there is no file system which allows you to save files with no means of being able to read/use them. So if you want to store a file on the iPad you first need an app on the iPad that supports that file type.
    How you then get the file onto the iPad and into the app will depend on what the app is and what transfer method(s) it supports. e.g. some apps use the file sharing section at the bottom of the device's apps tab when connected to your computer's iTunes, some apps support the transfer of files via your wifi network, the iBooks app uses the Books section of your iTunes (and the device's Books tab) to sync content, and other transfer methods include email attachments, Dropbox etc. The file is then found by going into your chosen app and opening/using the file.

  • Please help me!--rendering makes the images or video blurry (very pixelated) deteriorates the image  Adobe Premier Elements 13  need help!  .jpg and mpeg images,  but I have never "rendered" before since I got APE 13 about 6 weeks ago.  I am desperate for

    Please help me!--rendering makes the images or video blurry (very pixelated) deteriorates the image  Adobe Premier Elements 13  need help!  .jpg and mpeg images,  but I have never "rendered" before since I got APE 13 about 6 weeks ago.  I am desperate for assistance!

    That's going to be a ridiculous waste of money and energy.
    First of all, the current ATI drivers don't support multiple GPUs, so at the moment even a single 4870X2 would be only a 'normal' 4870 (which is quite a speed beast already). GFX drivers evolve rapidly, so things might look different next month, but when it comes to Linux and hardware there's one Golden Rule: stay away from the newest stuff and wait for proper support to get coded.
    I also wonder what power supply could possibly cope with the differences between idle and full load; that's way beyond 400W. But then, I'm one of those "quiet&green" types where >100W idle is already a bit much.
    I kind of understand that you want to get it done and not worry about hardware for the next 10 years or so, but that's simply not how the hardware world works and never did. At least not for the average consumer.

  • I have a macbook pro the early 2007 version. How can i download The mac app store and will i be able to use the iLife'11?

    I have a macbook pro the early 2007 version & i am new to the mac apple world. How can i download The mac app store and will i be able to use the iLife'11? I want to buy the iLife software but I am not sure if it will work on my computer.

    Hi Kristy,
    Update to 10.6.8 to use the app store.
    Your MBP's hardware requirements should be fine for iLife 11:
    http://support.apple.com/kb/HT4163

  • Can i store and retrieve image using sql command?

    hi
    the following is what i enter to store image in table using sql*plus
    however i encounter some errors as shown below.
    i wondered if i actually can use sql to store image and retreive image
    or i need other developer beside sql to do.
    create table img_storage
    (id     number primary key,
    image     ORDSYS.ORDImage);
    CREATE or REPLACE procedure ADD_image (tmp_id number, file_name varchar2)
    as
         obj ORDSYS.ORDImage;
         ctx raw(4000) := null;
    begin
         INSERT INTO img_classifier (id, image) VALUES (tmp_id,
         ORDSYS.ORDImage (ORDSYS.ORDSOURCE(EMPTY_BLOB(),
         NULL,NULL,NULL,SYSDATE,NULL),
         NULL,NULL,NULL,NULL,NULL,NULL,NULL));
         COMMIT;
         SELECT image into obj FROM img_storage
         where id = tmp_id FOR UPDATE;
         obj.importFrom(ctx,'FILE','IMGDIR',file_name);
         obj.setproperties();
         UPDATE img_storage
         SET image = obj where id = tmp_id;
         COMMIT;
    end;
    show errors;
    create or replace directory imgdir as 'c:\image\';
    exec add_image(1,'argvseng.jpg');
    BEGIN add_image(1,'argvseng.jpg'); END;
    ERROR at line 1:
    ORA-00001: unique constraint (SYS.SYS_C002717) violated
    ORA-06512: at "SYS.ADD_IMAGE", line 7
    ORA-06512: at line 1
    how to reslove the error as shown above.
    or sql does not support ordsys.ordimage such command.
    hmm very confused ....
    what is the difference bet using blob for image and ordsys.ordimage?

    This has nothing to do with intereMedia.
    This is a basic SQL issue.
    A primary key cannot have duplicate entries in a table as the error message suggests.
    Before you call your peocedure you can delete the row with 1 as the primary key, or call the insert peocedure using a primary key that is not being used.

  • Store and retrieve image in database using WD Java

    Hi All,
    I have to store and retrieve an image in oracle database. I have gone through the below blog and forum...
    How to display an image, which is stored in a database?
    The specified item was not found.
    I am able to store image in byte format(oracle data type BLOB) and when i try to retrieve it i am not getting the image....Sorry for my poor technical knowledge.
    can some body help me, please......
    Regards,
    G.

    Hi,
    my code is working... I am able to upload and retrieve the image. But now I am getting the below exception...
    Exception from image insert>> java.sql.SQLException: Data size bigger than max size for this type: 6770
    Below is the code I am uing...
    ConnectDataBase condb=new ConnectDataBase();
        IWDMessageManager mgnr=wdComponentAPI.getMessageManager();
         IPrivateDBImageView.IVn_FileElement  fileelement =
                                  wdContext.nodeVn_File().getVn_FileElementAt(0);
                             IWDResource resource=wdContext.currentContextElement().getResource();
    InputStream in=resource.read(false);
    ByteArrayOutputStream bOut=new ByteArrayOutputStream();
                             int lenght=0;
                             byte part[]=new byte [ 50000 ];
                             while((lenght=in.read(part))!=-1)
                             bOut.write(part,0,lenght);     
              Statement  stmnt=null;
                   Connection con=null;
                   String strQuery=null;
                   String strProp_Details=null;
                   try {
                        con=condb.getConnection (mgnr);
                        stmnt=con.createStatement();
                   PreparedStatement pst=con.prepareStatement("insert into VMS_Image values(?,?,?)");
                        pst.setInt(1,4);
                        pst.setString(2,"srinu1234");
                        pst.setBytes(3,bOut.toByteArray());
                        pst.execute();
                        bOut.close();
                        in.close();
                        mgnr.reportSuccess("Inserted");
                   catch (SQLException e) {
         mgnr.reportException("SQLException from image insert>>"+e,false);
                   catch(Exception e)
                             mgnr.reportException("Exception from image insert>>"+e,false);     
                        finally
                        try
                        if(stmnt!=null)
                             stmnt.close();
                             stmnt=null;     
                        if(con!=null)
                             con.close();     
                             con=null;
                        catch(Exception e)
                             mgnr.reportException("Exception in Closing from image insert>>"+e,false);
    first I used byte of 101024, then 501024 and finally tried with byte of 50000. I am getting the above exception if the image size is more than 4kb....
    Regards,
    Srinivas.
    Edited by: srinivas sistu on Aug 1, 2008 2:26 PM
    Edited by: srinivas sistu on Aug 1, 2008 2:34 PM

  • How to store and retrieve images from database...

    Hi All
    Anubody tell me plz how to store images in database using jsp.
    and how to retrieve tme.
    Plz reply...
    Anurag

    Exactly
    try the links below may be those might help u in store and retrieval any kind of file.
    http://www.mysqltalk.org/insert-blob-example-vt112861.html
    https://java.sun.com/j2se/1.5.0/docs/guide/jdbc/blob.html
    http://javaalmanac.com/egs/java.sql/GetBlob.html
    http://publib.boulder.ibm.com/infocenter/idshelp/v10/index.jsp?topic=/com.ibm.jdbc.doc/jdbc142.htm
    and a dearly advice friend please query google b4 you post any query out here.

  • How do I select and delete images in Numbers?

    Hi,
    I need to delete some images in a previous saved numbers spreadsheet.
    I cannot select any image individually, if I click on one cell all images are un-selected automatically.
    After pressing ESC and then Cmd+A I'm able to select all images in the spreadsheet but I don´t know
    how can I select an image and delete it?
    This simple process is getting really frustrating.
    Any help/hint is welcome!
    Thanks in advance.

    If you pasted the image into a cell.  select the cell, then open the cell formatter.  Change the cell background fill to "No Fill":

  • Forms6i, read and write Images to BLOB

    I read and write jpg's to the database with this commands:
    Read_Image_File (V_Filename, 'JPG', 'BILDER.IM_BILD');
    Write_Image_File (V_Filename, 'JPG', 'BILDER.IM_BILD', No_Compression, Original_Depth);
    My problem is, that forms stores a jpg-format to the db, that cannot be read from java-programs.
    The other way, when java stores jpg's to the BLOB, then forms can work fine with this images too and java also...
    What does forms do, when it stores jpg's to the db, so that other programs cannot use the images?
    Gerd

    When you post code, please use the code tags using the code button available on the message entry page. It makes it much easier to read.
    Do you have a question?

  • How can I store and delete photo albums

    The capabilities of the new iPad 3 using 0S 5.1 to manage photos remain a mystery.  I hope by explaining the workflow I am considering, I may be able to resolve this dilemma.  I would like to use the ipad3 to make a backup of my daily photos while traveling.  Here is my plan.  I would appreciate if anyone is knowledgeable to let me know if I can or cannot do the following:
    Establish a new folder directly onto the iPad (I know I can do this)
    Download my pictures for the day from my camera card into this new folder using the SD connector of the Apple Camera Connection Kit.
    Support RAW (rw2 for the Lumix fz28) and JPEG images
    View the new pictures
    The next day, either: (a) download only the NEW pictures to the album by using a capability of the photo program to do this (I don’t want to have to select over 100 photos one by one manually) or (b) establish a new album, download the entire SD card with the previous days and the current days pictures into it, and then delete both the first album and all the pictures in it, without having to search for them and select one at a time to delete. I want to delete the previous days album to minimize memory usage.
    Copy the photos to my computer, preferably with Photoshop Elements, when I get home.
    If this cannot be done with the software that comes with the iPad, is there an app available that could better be used for my photo backup needs.
    The ability to minimally Edit and Move some pictures within the iPad while away would be nice to have, but not crucial. 
    I would like to purchase an IPAD 3 with 64 gig in April, but I probably will not do so if I cannot get these capabilities.  Thank you in advance for your input.

    Provide the name of the program you are using so a Moderator may move this message to the correct program forum
    The Cloud is not a program, it is a delivery process... a program would be Photoshop or InDesign or Muse or ???

  • Help App store and Itunes wont work on my ipod touch 4G with ios 5.0.1

    When I open the app store or itunes store and try to search something it freezes and crashes I need help

    Try resetting the iPod...
    Hold the On/Off Sleep/Wake button and the Home button down at the same time for at least ten seconds, until the Apple logo appears.
    If that doesn't help, tap Settings > General > Reset > Reset Network Settings.
    Restart your iPod. Hold the On/Off Sleep/Wake button down until the red slider appears. Slide your finger across the slider to turn off iPhone. To turn iPhone back on, press and hold the On/Off Sleep/Wake button until the Apple logo appears.
    Now try the App or iTunes Store.
    If you still need help try here >  Can't connect to the iTunes Store

  • Store and retreive image/bitmapdata to/from local storage in iOS-app

    I'm trying to store and retreive cam-captured bitmapdata to the local app-space, but after a whole day of searching and trying I can't find any working example.
    It's no problem capturing cam-bitmapdata, but how to store (and retreive).
    Thanks!

    If its just a problem of saving the bitmapdata, follow along:
    http://actionsnippet.com/?p=1093
    Use http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/filesystem/File.h tml#applicationStorageDirectory to resolve to the correct location.

  • Firmware Management and Deleting Images/Packages

    I was trying to delete some older firmware packages and was wondering if anyone had an easier way to remove the associated images. If you simply remove a package and the image is still there you get all sorts of Major warnings (image-deleted).
    It would be much easier if you delete an old package ie. ucs-k9-bundle-b-series.2.0.4b.B.bin that is automatically deletes it's related Image so these errors don't appear, especially if you have upgraded a few times.
    http://www.cisco.com/c/en/us/support/docs/servers-unified-computing/ucs-manager/110475-ucs-firmware-management-00.html
    Thanks

    Removing packages will reclaim space, and can only be done, if there are no more any references to images !
    Exactly, I want to first remove the references so I can then delete the older packages. If not, I am left with annoying error messages referring to the deleted package...

  • Need help in archiveing and deleting records

    Hi frnds
    I wrote a procedure to archive the records and delete the archived one but after inserting and deleting the tot counter is not working and its showing 1 record inserted and i didnt tried the deletion part,pls find my code and how to get the correct no of records inserted as out put and same for deletion.One more thing,before deletion i want to confirm all the records which i going to delete is already inserted eg,if i could'nt able to do insert the specific no of rows the program shud exit without doing the deletion,How to accomplish that
    Declare
    cnt NUMBER := 0;
    tot number :=0;
    CURSOR ins IS
    select count(*) from Cal_log
    where trunc(c_date) ='11-Aug-2008';
    BEGIN
    FOR rec IN ins LOOP
    insert into Calls_arc
    select * from Cal_log
    where trunc(c_date) ='11-Aug-2008';
    tot :=tot + 1
    cnt := cnt + 1;
    IF (cnt >= 100) THEN
    COMMIT;
    cnt := 0;
    END IF;
    END LOOP;
    DBMS_OUTPUT.PUT_LINE('inserted ' || tot|| ' records in call_arch.');
    FOR rec IN ins LOOP
    delete from Cal_log
    where trunc(c_date) ='11-Aug-2008';
    tot := tot + 1;
    cnt := cnt + 1;
    IF (cnt >= 100) THEN
    COMMIT;
    cnt := 0;
    END IF;
    COMMIT;
    DBMS_OUTPUT.PUT_LINE('Deleted ' || tot || ' records from Cal_log');
    END;

    Since
    CURSOR ins IS
    select count(*) from Cal_log
    where trunc(c_date) ='11-Aug-2008';always returns one row, your loop
    FOR rec IN ins LOOPdoes not make much sense. But it does not hurt. The real issue with your code is you increment tot by one while insert processes more than one row (all rows for Aug 11). You should use %ROWCOUNT. And one more thing, never rely on implicit date conversions since default date format is client session sependent. Anyway, all you need is:
    BEGIN
        insert
          into Calls_arc
          select  count(*)
            from  Cal_log
            where c_date >= to_date('11-Aug-2008','dd-mon-yyyy')
              and c_date <  to_date('12-Aug-2008','dd-mon-yyyy');
        DBMS_OUTPUT.PUT_LINE('inserted ' || SQL%ROWCOUNT || ' records in call_arch.');
        delete
          from Cal_log
          where c_date >= to_date('11-Aug-2008','dd-mon-yyyy')
            and c_date <  to_date('12-Aug-2008','dd-mon-yyyy');
        COMMIT;
        DBMS_OUTPUT.PUT_LINE('Deleted ' || SQL%ROWCOUNT || ' records from Cal_log');
    END;
    /SY.

Maybe you are looking for

  • Why are my Hyperlinks not working in mail?

    i Have rebooted and am able to read my mail but nothing happens when I touch the hyperlinks why is this?

  • Custom search criteria in MSS Team Calendar

    My requirement is to add a custom entry (All Salaried/Exempt employees) in the Employee Selection (Display Data For) drop down in MSS Team Calendar. I have created a custom org structure view by copying the one for "All Employees" - MSS_LTV_EE_ALL Th

  • Tab Navigation in ABAP screens

    Hi All, Is the navigation sequence of the screen elements in a dynpro screen on "tab" event is from left to right and top to bottom always irrespective of whether the fields are in multiple subscreens/tab pages?. Is there a way to control the tab nav

  • Undeploying Application Errors

    <Nov 15, 2002 9:05:18 AM PST> <Error> <J2EE> <Error undeploying application asd: null> <Nov 15, 2002 9:05:18 AM PST> <Error> <Management> <InvocationTargetException setting attribute Deployed on MBean mydomain:Location=myserver,Name=asd,Type=Applicat

  • Excel "Unreadable Content" Error

    I am wondering if anyone else has seen this issue. If the file shellstreams.dll (for Photo Streams, it appears) is present on a Windows PC, Excel will occassionally crash when opening up an .xlsx file.  Simply renaming that dll resolves the issue.  T