How to Insert Image in a Column of a table

Hi
I have read several documentations but still could not find any relevant one that can help me in inserting a image in a BLOB column of a table.I have read about DBMS_LOB but still not clear how to insert an image in the table.
I followed following steps :
create table Emp_Identity(Id Number,Photo BLOB);
Insert Into Emp_Identity(1,'d:\vishal.bmp');
Please tell me steps to be followed.
Regards
Vishal Chaudhry
null

I am using Developer 2000 Forms 6i as Front End (Oracle 8.1.6)
My table structure is:
SQL> desc test_lob
Name Data Type
ID NUMBER
NAME VARCHAR2(100)
PHOTO BLOB
SOUND BINARY FILE LOB
IS there any way to display the BFILE contents on the frontend.....?
<BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by vishal chaudhry ([email protected]):
Hi,
I could actually insert an image in a BLOB type column from the backend(Sql plus) not directly but by using BFILE and see that image on the frontend (Forms 6i Developer 2000,Item type is Image as there is nothing like BLOB/BFILE in front end) using the following procedure :
IS there any way I can insert an image directly in a BLOB column from the backend rather than using BFILE?
CREATE OR REPLACE PROCEDURE loadLOBFromBFILE_proc IS
Dest_loc BLOB;
Src_loc BFILE := BFILENAME('SOUND_DIR', '123w.bmp');
** SOUND_DIR is a logical directory created by giving path of the server
** Create Directory SOUND_DIR as 'd:\u020\o816\ctx\test'
** d:\u020\o816\ctx is the physical path of the server \\pslndb\ctx$
** test is the dummy testing directory created on the server
** 123w.bmp is lying in the test directory
Amount INTEGER ;
BEGIN
Amount := DBMS_LOB.GETLENGTH(Src_loc);
SELECT photo INTO Dest_loc FROM test_lob
WHERE ID = 1
FOR UPDATE;
/* Opening the source BFILE is mandatory: */
DBMS_LOB.OPEN(Src_loc, DBMS_LOB.LOB_READONLY);
/* Opening the LOB is optional: */
DBMS_LOB.OPEN(Dest_loc, DBMS_LOB.LOB_READWRITE);
DBMS_LOB.LOADFROMFILE(Dest_loc, Src_loc, Amount);
/* Closing the LOB is mandatory if you have opened it: */
DBMS_LOB.CLOSE(Dest_loc);
DBMS_LOB.CLOSE(Src_loc);
COMMIT;
END;
<HR></BLOCKQUOTE>
null

Similar Messages

  • How to manage image in a column of a table

    Hi all,
    I am using Jdeveloper 11.1.1.2 and ADF faces.
    I would like to have a table with a column to save an image. After that I would like to have a page .jspx that visualize the fields of the table, including the image.
    I would like to know how I have to do:
    1) in the database to save the image
    2) to visualize and manage images on my .jspx page
    I have read something on the forum and googling, but I have found threads of one-two years ago, and I don't know if they give to me the right solution for my version of Jdeveloper.
    Can you give me a step by step procedure to solve my problem? Do you have any links to suggest me?
    Regards
    Andrea

    We did a web app a while ago and used image files for warehouse to show images of parts
    1. BLOB
    2. We didn't use adf. also I am using 10.1.3.4.

  • How to insert message style text columns in database tables

    Hi All,
    i have two pages.
    in first page segment1 lov is their.once u select the segment1 and click on the create button its navigate to next page.
    and display the releted segment1 details(these columns are message text input fields but read only columns).
    plz help me those columns are insert into database tables.
    its very urgent
    Thanks
    Latha.

    Hi Anil,
    plz help me still i am faceing the problem
    so plz help me because i dont know java.
    i wrote below code and i got the below error.
    if(pageContext.getParameter("Submit")!=null)
    String projnumber=pageContext.getParameter("ProjectNO");
    //String projectnumber=pageContext.getParameter("Projectnumber");
    String oldoperationid=pageContext.getParameter("EmployeeNumber");
    String newManagerName=pageContext.getParameter("NewManagerName");
    String ProjectID=pageContext.getParameter("ProjectID");
    String OldOperationName=pageContext.getParameter("OperationsManager");
    String OldOperationID=pageContext.getParameter("OldOperationID");
    OAMessageTextInputBean projnumberbean =webBean.findIndexedChildRecursive("ProjectNO");
    String projnumber=null;
    if(bean!=null)
    projnumber = (String)projnumberbean.getValue(pageContext);
    Serializable[] params = {projnumber,oldoperationid,newManagerName,ProjectID,OldOperationName,OldOperationID};
    am.invokeMethod("xxinsertpagelogic",params);
    and i wrote import also.
    import oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean;
    my errors are
    Error(64,78): incompatible types; found: oracle.apps.fnd.framework.webui.beans.OAWebBean, required: oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean
    Error(65,13): duplicate definition of variable projnumber in method processFormRequest(oracle.apps.fnd.framework.webui.OAPageContext, oracle.apps.fnd.framework.webui.beans.OAWebBean)
    Error(66,9): variable bean not found in class wnsgs.oracle.apps.pa.projectinfo.webui.ProjectInfoCreateCO
    plz help me.
    its very urgent
    Thanks
    Edited by: Latha on Jan 4, 2012 9:57 PM
    Edited by: Latha on Jan 4, 2012 10:00 PM

  • 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 images in a table

    Hi all,
    Iam working On Oracle10g
    can any one explain how to insert images in a table.
    Any help will be much appreciated!!
    Thanks.

    Hi,
    Try like this
    step1: Create a folder & place the image in it.
    for eg: place the image 'Sunset.jpg' in 'IMAGEFILE' folder of D drive
    Step2: Create a Directory in sql*plus as
    CREATE DIRECTORY IMAGEDIR AS 'D:\IMAGEFILE';
    Step3: Grant previlage to user
    GRANT READ ON DIRECTORY IMAGEDIR TO PUBLIC;
    Step4: Create the table in which you want to insert the image
    create table loadalbum
    (name varchar2(100),
    image blob)
    Step5: Create the procedure as
    declare
    l_blob blob;
    l_bfile bfile;
    begin
    insert into loadalbum values ( 'Sunset', EMPTY_BLOB() )
    returning image into l_blob;
    l_bfile := bfilename( 'IMAGEDIR', 'Sunset.jpg');
    dbms_lob.fileopen( l_bfile );
    dbms_lob.loadfromfile( l_blob, l_bfile, dbms_lob.getlength( l_bfile ) );
    dbms_lob.fileclose( l_bfile );
    end;
    Now you can know whether the image is inserted or not by
    SELECT COUNT(*) FROM LOADALBUM;
    COUNT(*)
    1
    which means image is inserted.
    Hope this may help you.

  • 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

  • *Urgent*How to insert data from MS SQL to the table that create at the adobe form?

    Hi,
    I'm using Adobe life cycle designer 8 to do my interactive form. I would like to ask how to insert data from MS SQL to the table that i have created in my adobe interactive form?
    I really need the information ASAP as i need to hand in my project by next week... i really appreciate any one who reply this post.
    Thanks

    Tou need to do a couple of things
    1. On the Essbase server, set up an odbc system connection to your MySQL database
    2. In the load rule , go to the file menu and select open SQL data source and in the data source put in your SQL statement . A couple of hints. Where it says Select, don't put in the word select and where it say from don't put in from. The system adds them for you. The easiest way ti enter a SQL statement is to do it all in the select area So if your SQL would normanlly say select * from mytable just enter the code as * from mytable in the select area
    The click ol/retrieve and enter in your connection info. Itshould bring data back into the load rule. Save the load rule and use it

  • How to insert data in a column with uniqueidefier data type

    Guys,
    I need insert data in a column with uniqueidefier data type, when i am trying to that getting error.
    error message says: "Conversion failed when converting from a character string to uniqueidentifier."
    I have data in table a col1,col2,col3,col4 - col3,col4 has datatype as varchar and i am updating table b columns col1,col2 with table a col3 and col4.
    Please guide how to do it.

    Hi,
    Not any String can be convert to uniqueidentifier.
    1. you have to make sure u use a value which is fir to be uniqueidentifier
    2. Use convert or cast in the insert query in order to convert the string into uniqueidentifier
    insert X ... convert(uniqueidentifier, 'string which fit to be convert to uniqueidentifier')
    Please post DDL+DML for more specific help
    DDL = Data Definition Language. In our case that is, CREATE TABLE statements for your tables and other definitions that are needed to understand your tables structure and there for let us to test and reproduce the problem in our server. Without DDL no one
    can execute any query.
    How to get DDL: Right click on the table in Object Explorer and select script table as CREATE. Post these create table scripts here.
    DML = data manipulation language is a family of queries used for manipulating the data it self like: inserting, deleting and updating data. In our case we need some sample data in order to check the query and get result, so we need some indert query for
    sample data.
    If you post a "create query" for the tables and "insert query" with some sample, then we could help you without Assuming/Guessing. There is a reason that DDL is generally asked for and expected when discussing query problems - it helps
    to identify issues, clarify terminology and prevent incorrect assumptions.  Sample data also provides a common point of reference for the discussion. A script that can be used to illustrate or reproduce the issue you have, will encourage others to help.
    [Personal Site] [Blog] [Facebook]

  • How to insert image in forms?

    Hi Friends,
    I m new to Forms. plz tell me how to display image in canvas (form)?
    I m using Forms 6i.

    do you want to show a static image or an image from the database?
    If its a static image have at look at this Re: Oracle FORMS with image background, is that possible?
    If its a database image you should have a table with a blob-column. If you use the databalock wizard and include that column in the block, it will generate you an image-item which can then be shown in the layout.
    Edited by: Andreas Weiden on 25.11.2008 21:58

  • How to Insert image file from fileChooser to a tabbedPane?

    Hi,
    Currently, i have encounted a problem halfway through my project. That is how do i insert images into a tabbedPane after selecting a image file from the fileChooser?
    Do anyone has any idea of how to solve the above problem?
    Thanks!!

    I would put the image in a JLabel and put the JLabel in the tabbed pane.

  • How to insert image in Blog Post

    Hi,
         I want to create a blog post. For that i have to insert some images in that post. These image are in my PC desktop. How to upload/insert these images in my blog post body.
        I am able to see a option 'Insert Image' in blog post editor. But it is asking me the URL of the image. I can brouse the image from desktop but how to get the URL of that image.
        The same problem also come while adding snaps in profile.
        Can anyone help me on this regards.
        I am sorry if it is not the right forum for putting such question. Also want to know which will be the right forum for putting such queries.
    Thanks & Regards,
    Abhishek Sarkar

    Hello,
    There is 2 ways to insert an image:
    1. You can select the picture icon on the tool bar
    and then the foolowing screen will allow you to upload your picture from your computer:
    2. You can also drug and drop the image directly from your computer to the text, this is the way I use.
    Hope it is helpful,
    Elidan

  • How to Insert a User Defined Column with CheckBox In ADF Swings

    I have create JTable by dragging a view object from Data Control Palette .But apart from columns listed in JTable i need to insert a User Defined column with Check Box selection option in each row .
    Can any one help me out to sort the problem.
    Regards
    Bhanu Prakash
    Message was edited by:
    user579125

    I retrieve 10 column from Database and build JTable. But apart from 10 column displayed i need to display one more column( User Defined) at run time with the check box option for each row . Because on select of corresponding check box i need to do some mathematical calculation. add also How do i know whether check box is selected or not.
    Regards
    Bhanu Prakash

  • How to insert image in the title bar?

    Hi experts,
    how to insert the image or icon in the title bar of a screen, similar to the screen below.
    Att.,
    Luiz.

    Hi Luiz,
    You can create them in GUI Status. If you are using a module pool program uncomment SET PF-STATUS '<STATUS-NAME>' statement, double click on  <STATUS-NAME> and you will be directed to the screen for setting your GUI status.There you can create buttons with desired icons. If it is a report program add SET PF-STATUS '<STATUS-NAME>'  statement to your program and follow the same procedure.
    Refer the wiki for more details.
    GUI Status of A Program using Menu Painter - ABAP Development - SCN Wiki
    Regards
    Anoop

  • How To Insert Cells Into One Column Only

    Can anyone advise me, how to insert a cell (or multiple cells) into +just one column+ whilst leaving everything else on the sheet exactly as it is?
    I'm migrating from Excel and can't find this functionality in Numbers
    Thanks in advance for any help

    Thank you for taking the time to reply, thereby removing the misery of me continuing to search for this absent function!
    I really wanted to like the iWork apps! I recently rebuilt one of my rigs and had the intention of making it a Microsoft-free computer - hence the purchase of iWork.
    However, the last few days of 'learning curve' I have stumbled upon an increasing number of incompatibilities and limitations when compared to Excel, and the lack of the function to insert a single cell into a sheet is the final deal-breaker for me, sadly.
    So, reluctantly, I am going to install my Microsoft Office 2008 suite and get back to where I was before. I will continue to look at the iWork apps but I suspect they'll fall to the wayside.
    Once again, many thanks for confirming what I was reluctantly concluding.

  • How to insert bytes in varchar2 column

    existed data:
    ALIAS VARCHAR2(240)
    SELECT ALIAS,DUMP(ALIAS,8) FROM AR_COLLECTORS WHERE COLLECTOR_ID=47880
    ¿¿¿     Typ=1 Len=9: 351,231,263,345,230,211,350,217,261
    How to create the same data from SQL PL/SQL?
    INSERT INTO AR_COLLECTORS (ALIAS) VALUES ( ???

    I'm not quite sure what you are asking here. DUMP is a function that shows the internal representation of the data stored in a field or variable. You do not need to store the DUMP values explicitly, they are derived from your actual data. If, for some inexplicable reason, you want to store the output of the DUMP command in another table, then you can do something like
    CREATE TABLE dumpvals (real_value VARCHAR2(400), dump_value VARCHAR2(4000));
    INSERT INTO dumpvals
    SELECT column,DUMP(column,8)
    FROM table;
    or, in PL/SQL
    BEGIN
       FOR r in (SELECT column tval,DUMP(column,8) dval
                 FROM table) LOOP
          INSERT INTO dumpvals
          VALUES(r.tval,r.dval);
       END LOOP;
    END;If you can give a fuller explanation of what you are looking for, perhaps someone could give a better answer.
    TTFN
    John

Maybe you are looking for

  • Image resize quality not saved in Save For Web Preset?

    L.S., I have been working on an Action to create 12 separate PNG's for further use in my icon-software. What I do is basically this: Start out with a 256x256px image, save it for web four times in steps from 256, 48, 32 and 16px, (32-bit) apply some

  • Vendor invoice - Profit Center not being pulled from cost-center

    Hi Guys, Please help me out with this: On the vendor expense line item, i am using an account which has a Field status group which is cost center - optional, business area - required and profit center - required. The cost center master has the profit

  • PDFDocumentCreationException

    Dear SDN Community,   I get the following error message when I try to view any of the PCR from MSS portal. Do you see any problem with credentials or license here. Please advice me. Thanks! Vivek. com.sap.tc.webdynpro.services.exceptions.PDFDocumentC

  • Impossible to open .dtproje file after re-installing SQL Server Management Studio

    Hi all, today, after re-installing SQL Server Management Studio from a package downloaded from MS web site (SQLManagementStudio_x64_FRA.exe), I tried to open a SSIS package file via Visual Studio and I get a message stating that  this type of project

  • Why is my shockwave player always crashing while playing zynga farmville2 on FB?

    while playing zynga farmville2 on FB, shockwave player continually crashes.  Sometimes it stops before the game finishes loading.  I usually end up killing the page.  I've used three different browsers and have problems in all three.  I've updated go