How to find the size of the downloaded image on a column of type blob in a table?

How to find the size of the downloaded image on a column of type blob in a table?

Vidya,

You can use the built in function dbms_lob.getlength to get the length (size) of a LOB column or a bfile type.
Check out this link.

http://download.Oracle.com/docs/CD/B10501_01/AppDev.920/a96612/d_lob2.htm#1008995

Tags: Database

Similar Questions

  • How to insert a pdf or jpeg image into a column of type blob of a table

    How to insert a pdf or jpeg image into a column of type blob of a table

    Hello
    Try this

    Loading an image into a BLOB column and showing through OAS
    -------------------------------------------------------------

    The steps are:

    Step 1.
    -------

    Create a table to store BLOBs:

    create BLOB table objects
    (id VARCHAR2 (255),)
    blob_col blob
    );

    Step 2.
    -------

    Create a logical directory in the database to the physical file system:

    create or replace the MY_FILES directory as "c:\images";

    Step 3.
    -------

    Create a procedure to load the BLOB from the file system by using the logic
    Directory. Gif 'aria.gif' must exist in c:\images.

    create or replace procedure insert_img as
    f_lob bfile.
    b_lob blob.
    Start
    insert into BLOB ("MyGif", empty_blob()) values
    return blob_col in b_lob;

    f_lob: = bfilename ("MY_FILES', 'aria.gif');
    DBMS_LOB. FileOpen (f_lob, dbms_lob.file_readonly);
    DBMS_LOB. LoadFromFile (b_lob, f_lob, dbms_lob.getlength (f_lob));
    DBMS_LOB. FileClose (f_lob);
    commit;
    end;
    /

    Step 4.
    -------

    Create a procedure that is called via Oracle Application Server to display the
    image.

    create or replace procedure get_img as
    vblob blob.
    raw buffer (32000);
    buffer_size integer: = 32000;
    offset of an integer: = 1;
    length of number;
    Start
    owa_util.mime_header('image/gif');
    Select blob_col from vblob of blobs where id = 'MyGif. "
    Length: = dbms_lob.getlength (vblob);
    While offset< length="">
    DBMS_LOB. Read (vblob, buffer_size, offset, buffer);
    HTP. PRN (utl_raw.cast_to_varchar2 (buffer));
    offset: = offset + buffer_size;
    end loop;
    exception
    while others then
    HTP.p (SQLERRM);
    end;
    /

    Step 5.
    -------

    Use the PL/SQL cartridge to call the get_img procedure

    OR

    Create this procedure in function and call it your PL/SQL code for
    correctly place the images on your HTML page through the PL/SQL Toolbox.

    from a html form

    1. create an HTML form where the image will be. You too
    need the file MIME type.
    2. create a procedure receives the form parameters. The file field will be a Varchar2
    parameter, because you receive the path of the image is not the image itself.
    3 insert the image file into the table by using 'Create a directory NAME as chemin_image' and
    Then use ' insert into the TABLE (row, BLOB_OBJECT, MIME_OBJECT) values (sequence.nextval, '.
    EMPTY_BLOB() 'GIF' or 'JPEG') BLOB_OBJECT, in the variable_blob, back
    variable_consecutive.
    4 load the file into the table using:
    DBMS_LOB. LoadFromFile (variable_blob, variable_file_name, dbms_lob.getlength (variable_file_name));
    DBMS_LOB. FileClose (variable_file_name);
    engage.

    Kind regards
    Simma...

  • I need to know how to find the download for windows XP Service Pack 3 to put on my computer

    I have a dell laptop inspiron 1000 with windows xp service pack 2 installed and I can't find a download for windows xp service pack 3 other than the iso image on microsoft.com, I have in the past found service pack 3, my laptop, will not let me use windows update can anyone please let me know how I can fix this so I can update my computer by windowsupdate or another method Thank you.

    Patrick,

    Please see the thread below for a possible solution:

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_xp-windows_update/cant-download-SP3/a71b55ee-10d4-410C-8b0b-a2114f7d8b94 >>

    UTC/GMT is 20:30 on Sunday, August 19, 2012

  • How to find the value duplicate of each column.

    I have it here are four columns,
    How can I find the duplicate of each columns value.

    with All_files like)
    Select ' 1000 'like BILL, "2000" AS DELIVERYNOTE, CANDELINVOICE ' 3000', '4000' CANDELIVERYNOTE of all union double
    Select ' 5000 ', ' 6000', ' 7000 ', ' 8000' Union double all the
    Select '9000 ', '1000', '1100',' 1200' from dual union all
    Select ' 1200 ', ' 3400', ' 6700 ', ' 8790' Union double all the
    Select ' 1000 ', ' 2000', ' 3000 ', ' 9000' Union double all the
    Select '1230', '2340', ' 3450 ', ' 4560' double
    )
    SELECT * from All_files


    Output should be as shown below.

    1000 2000 3000 4000
    9000 1000 1100 1200
    1200 3400 6700 8790
    1000 2000 3000 9000

    Required to check uniqueness columns.

    Thank you.

    Hello

    If you are not too concerned about performance, this should give you the desired result:

    SELECT distinct INVOICE, DELIVERYNOTE, CANDELINVOICE, CANDELIVERYNOTE
    FROM (
      SELECT a.*,
             count(*) over(partition by t.column_value) cnt
      FROM All_files a,
           table(
             sys.odcivarchar2list( a.INVOICE
                                 , a.DELIVERYNOTE
                                 , a.CANDELINVOICE
                                 , a.CANDELIVERYNOTE ) ) t
    )
    WHERE cnt > 1
    ;
    
  • How to find the way to rows and columns of matrix

    Hello everyone

    I have a matrix N * M with some of the elements with only 0 and 1.

    has every element that is 1 (line, column).

    I want to find the elments 1 and find the way to lines which is 1, and also the average columns.

    Thank you very much

    my email: [email protected]


  • How to find the 'missing' images easily in LR 3?

    In the beginning (I'm a technoidiot), I made some mistakes and stored images in 3 places.  To try to consolidate, I moved files and now some of the images "be found" by LR.  I am currently looking looking up the number of the image one at a time.

    In the library module, look at the on the left side.

    See all "missing files"?

    If so, just find the file to LR and all images of thhe in this folder will be re-found, too.

    If you don't have missing files and you need images, then you can always follow these steps:

    Right-click on the folder (in Control Panel folder) and click on "synchronize the folder. LR then check the file and images that are not in the record of exit and re - import those that you put in this folder.

    You can also do this with your parent folder and Sub folders will be synchronized.

    And don't forget: If you want to move pictures or folders around, always do go in LR (drag / move). This way above any change syou stay LR will do.

    WW

  • Store an Image in the column of type BLOB of a Table

    It is about saving an Image file, a temp_photo table.

    UNDER LINUX, I created the Directory object.
    Step # 1
    SQL > create directory MSGS3 as ' / home/HD/om4000/I_MESSAGES ";
    Created directory.

    Step 2: set up the temp_photo Table.

    SQL > create table temp_photo
    (
    ID NUMBER (3) NOT NULL,
    PHOTO_NAME VARCHAR2 (50).
    PHOTO BLOB
    );
    Table created.

    Step: 3 this is the procedure that I have created to load the file from the file system of the database.

    create or replace PROCEDURE load_file)
    number of P_ID,
    p_photo_name in varchar2) IS
    src_file BFILE.
    dst_file BLOB;
    lgh_file directory.
    BEGIN
    src_file: = bfilename ('MSGS3', p_photo_name);
    -Insert a NULL record to lock
    INSERT INTO temp_photo
    (id, photo_name, photo)
    VALUES
    (p_id, p_photo_name, EMPTY_BLOB())
    RETURN photo INTO dst_file;
    -lock the folder
    SELECT photo
    IN dst_file
    OF temp_photo
    ID WHERE p_id =
    AND photo_name = p_photo_name
    UPDATE;
    -Open the file
    DBMS_LOB. FileOpen (src_file, dbms_lob.file_readonly);
    -determine the length
    lgh_file: = dbms_lob.getlength (src_file);
    -Read the file
    DBMS_LOB. LoadFromFile (dst_file, src_file, lgh_file);
    -update the blob field
    UPDATE temp_photo
    Photo SET dst_file =
    ID WHERE p_id =
    AND photo_name = p_photo_name;
    -close file
    DBMS_LOB. FileClose (src_file);
    END load_file;
    /


    Step 4: when I test it by running the procedure in the following assistance:
    SQL > execute load_file (1, 'Omega5000.jpg');

    I get the following error:

    Error from line 5 in order:
    run load_file(1,'Omega5000.gif')
    Error report:
    ORA-22288: file or LOB FILEOPEN operation failed
    No such file or directory
    ORA-06512: at "SYS." DBMS_LOB", line 805
    ORA-06512: at "HD. Load_file", line 23
    ORA-06512: at line 1
    22288 00000 - "file or LOB operation %s failed\n%s".
    * Cause: Failure of the attempted operation on the file or the LOB.
    * Action: See the following error message in the more detailed error stack
    information. In addition, make sure that the file or LOB exists and that
    privileges are set for the specified operation. If
    the error continues, report the error to the user DBA.

    He said: no such file or directory, but I double checked that the file is located in the same directory and directory is it physically (for which I created the above directory object.)
    Can someone help me where I'm doing something wrong. This is the first time I use the BLOB in my table. Can anyone suggest what's not here.

    >
    He said: no such file or directory, but I double checked that the file is located in the same directory and directory is it physically (for which I created the above directory object.)
    >
    Oracle is disagreeing with you.

    Post your proof that the file exists in the path you provided.

    See this example Oracle-base
    http://www.Oracle-base.com/articles/Misc/HTML-with-embedded-images-from-plsql.php
    >
    CONN / AS SYSDBA
    CREATE or REPLACE DIRECTORY of images AS "/ host /";
    GRANT READ, WRITE on DIRECTORY images TO test;
    >
    Write down everything you missed? Tip: Look at the last character of the DIRECTORY string. Second Tip: See the grant?

    SQL>create directory MSGS3 as '/home/mh/om4000/I_MESSAGES' ;
    
  • How to find the middle name of any column NAME

    I wrote under request

    why this market not could you please help me?

    Select substr (ename, instr (ename,' ', 1, 1), instr (ename, ' ', 1.2)) of e1

    InStr, primary function must return the first position of the space and

    2 nd instr, function should return 2nd space

    so we can specify in substr function to extract the form position of string from this place to that place

    It would be very useful that you explain the reason

    Best regards

    Prem kumar

    Select

    -case when length (substr (ename, instr (ename,' ', 1.2))) = length (ename) then

    (case when length (substr (name, instr (ename,' ', 1.1))) = length (ename) then null)

    of another substr (ename, instr (ename,' ', 1, 1) + 1) end)

    of another substr (ename, instr (ename,' ', 1, 1) + 1, instr(ename,' ',1,2)-instr(ename,' ',1,1)-1)

    end middle_name

    of e1;

    Select

    -case when length (substr (ename, instr (ename,' ', 1.2))) = length (ename) then

    (case when length (substr (ename, instr (ename,' ', 1.1))) = length (ename) then null)

    of another substr (ename, instr (ename,' ', 1, 1) + 1) end)

    of another substr (ename, instr (ename,' ', 1, 1) + 1, instr(ename,' ',1,2)-instr(ename,' ',1,1)-1)

    end middle_name

    from (select 'asw nag raj' ename of double)

    Union

    Select "raj asw ght" double

    Union

    Select 'raj asw dfjadf Tom' from dual) e1;

  • How to find the locaion of a particular column in a database

    Hi experts,

    I have the column name x. I want to know under what table it is present.


    What may be the syntx for sql.

    Thank you
    V
    select owner,table_name
    from all_tab_columns
    where column_name = 'XXX'
    /
    

    where XXX is the column name, looking for

  • Camera: Find the last image?

    Hello

    Are there examples of how to find the last image taken after invoking the camera?

    Thank you

    Hi and welcome to the forums!

    If you take the picture and save, and can't find it? Or you take pictures

    Return to the back and you want to know where they are stored as you pull?

    Go to the media and click the photos, as soon as the images are displayed

    Highlight it, click menu, properties. It will show you, device, media and file

    and size.

    You can set the previous directory. Unit > menu button > options.

    Here you can set options for the camera with flash, color, size, and storage in the

    media folders,

    Thank you

    Bifocals

  • says that there is an update of firmware available for my 3 t time capsule. I get "an error occurred when downloading". How to find the problem?

    I said that there is an update of the firmware available for my 3 t time capsule. I get the message "an error occurred when downloading". How to find the problem? I have elcapitan 10.11.6 and capsule version 7.7.3

    Try temporarily, connect your MacBook Pro to your Time Capsule using an Ethernet connection... If not already, then try downloading the firmware again.

  • How to find the size of the virtual server?

    Hello

    We intend to pass our applications 4 virtual servers has 2 physical servers. In this process, we need to identify the size of the current virtual servers to use as a starting point to configure or add the size in physical server. can anyone provide information on whats stats to be noticed and how to find the size of the current virtual servers?

    Thank you

    Hi Sekhar, there.

    in general, it is a fairly complex task if you want to size the new platform correctly, i.e. not to oversize it and have very low use below, i.e. spend too much on equipment.

    In fact, it's the first thing to consider the level of use of the new platform. Most likely your organization (HW and infrastructure) has targets to a minimum. optimal and maximum usage levels.

    In the case where you do not have this as a starting point, and then you continue with load average and the current peak (CPU, RAM, NW). To these basic lines, you can use the statistics of WLS Admin Console, where the use of CPU and memory statistics are presented since the server was last started. For more detailed statistics, you can use WLDF to capture measures key at regular intervals, and then base your analysis of these data.

    Finally and above all, the size of FS, but I've seen some comments above related to the size of the FS.

    HTH,

    A.

  • How can I find the download for CS4 Web Standard?

    How can I find the download for CS4 Web Standard?

    Hello

    Download Adobe Creative Suite 4 products refer

    Thank you

  • How to find the size of the table?

    Hi all

    Can anyone suggest how to find the size of the table? I had a few (15272 selected lines) on the name of "CMPT_" How can I check only 'CMPT_' size tables?





    Please someone help give the SQL query to run.


    Thanks in advance.


    Vincent

    madala03 wrote:

    Hi thanks for the reply

    I'm out like below

    SUM(BYTES/1024/1024)

    --------------------

    25383.25

    But how to check all the name of tables CMPT and their sizes?

    Select nom_segment, dba_Segments sum(bytes/1024/1024) where nom_segment like ' % CMPT GROUP BY nom_segment;

  • How to find the size of the semantic model

    Hi all

    Please can you tell me how to find the size of the semantic model.

    Thank you
    INDU

    Hi Indu,

    A couple of several things:

    1 we still need an application, in order to account for the storage of the Table in the Application

    This query gives you the name of application table

    Select the table table_name from mdsys.sem_model$
    where model_name = '';

    This will give you the size in MB

    Select semmodel.table_name, dbaseg.bytes/1024/1024 MB
    of mdsys.sem_model$ semmodel, dba_segments dbaseg
    where semmodel.table_name = dbaseg.segment_name
    and semmodel.model_name = '';

    2. If the model is the only one of the semantic network, you can get the space used by the table of $ RDF_VALUE using this query

    Select bytes/1024/1024 MB dba_segments where nom_segment = '$RDF_VALUE ';

    If there are several models, this space is shared between all of them.

    Kind regards!
    Jorge

Maybe you are looking for