I have the blob column in a table. I want to break up the value of the column in characters varchar2 (4000) (block).

Example of

create table test (id primary number, data key blob);

I want to display like

Select code, data of the test;

ID data

1 character 4000

1 character 4000

1 character 4000

.

.

and soon.

Please help me on this

BLOB stores binary data. What is the point of converted them to a varchar2? If the LOB will store the character data, then the appropriate data type would be CLOB. Said that, assuming that you will use CLOB here is the answer to your question.

drop table temp purge;

create table temp

(

integer ID

clob c_lob

);

declare

CLOB var;

Start

DBMS_LOB.CREATETEMPORARY (var, true);

because me in 1.32 loop

DBMS_LOB. WriteAppend (var, 1000, rpad ('x', 1000, 'x'));

end loop;

insert into temp (id, c_lob) values (1, var);

insert into temp (id, c_lob) values (2, var);

commit;

end;

/

Select id

rno

, length (dbms_lob.substr (c_lob, 4000, offset)) c_lob_var_len

, dbms_lob.substr (c_lob, 4000, offset) c_lob_var

de)

Select id

, ((level-1) * 4000) + 1 offset

c_lob

level NWR

temp

connect

by level<=>

and prior id = id

and dbms_random.value (prior) is not null

);

Tags: Database

Similar Questions

  • If I open a picture of the bridge, I often have the large white or black areas/blocks/rectangles in the pic. Changes in areas, if I choose another size. If I save the pic is ok, nothing to see rectangles. What is c? How to stop it? Thank you.

    If I open a picture of the bridge, I often have the large white or black areas/blocks/rectangles in the pic. Changes in areas, if I choose another size. If I save the pic is ok, nothing to see rectangles. What is c? How to stop it? Thank you.Bildschirmfoto 2015-06-20 um 18.04.10.png

    It is a question of gpu. It has been discussed many times here. See this thread. https://forums.Adobe.com/thread/1855166?q=black%20and%20White%20squares

  • APEX - opening World document (and other files) stored in a blob column?

    Hello

    I have an application developed in Oracle Apex 3.2.1 and RDBMS Oracle 9.2.0.8 (SUN SOLARIS SPARC 64-BIT).

    I have a table called BAC_ARQUIVO, with the following structure:

    CREATE TABLE BAC_ARQUIVO
    (NAME VARCHAR2 (4000), / * name of the file stored in a BLOB column * /)
    TOPIC VARCHAR2 (4000), / * a brief presentation of this file stored * /.
    Identification NUMBER, / * an identification of this file - it s a PK of this table column * /.
    BLOB BLOB_CONTENT, / * Blob field to store different types of files - XLS, DOC, PPT, PDF, EXE, ZIP, etc.) ;
    Mime_type VARCHAR2 (4000) / * Identification whose file type is stored in BLOB field * /.
    )


    The field BLOB_CONTENT in this table can store:

    -Executable files;
    -MS-world Documents (DOC);
    -Zip Files (ZIP).
    -Ms-Excel (XLS) files;
    -Ms-Powerpoint files (PPT);
    -Adobe (PDF) documents.

    In fact, in this application, APEX, I developed an interactive report in which the user can download these files to the desktop without problem.

    But now, my user I would like to know if it s possible ask APEX can OPEN some of these files stored on this download of WITHOUT BLOB column.

    My user would like to see a hiperlink (or button) that, if you press on/accessed, can open a new page (or page within the application) with the document. Doesn´t need to edit this file oppened. He wants only to see.

    For example, if the file stored in the blob column is type ms word, so the application opens an MS-WINDOWS application with these files.

    Is this possible?

    In this forum, I saw this it possible s to open a file stored on the directory "/ i /", but I need to open the file stored in the BLOB column. I Don t want to store the file in the operating system of the server.

    Could someone show me how it could be done?

    Best regards

    Sergio Coutinho

    Hi Sergio,

    You might find this link useful:

    http://www.Oracle.com/WebFolder/technetwork/tutorials/OBE/DB/Apex/R31/apex31nf/apex31blob.htm

    See also the Mask of Format download BLOB :

    {message: id = 9716335}

    Here I gave the format mask for APEX 4.0, which will be slightly different for 3.2.1 and proposed changes
    in the format of mask are:
    (1) mask format: DOWNLOAD
    (2) content-disposition: Inline

    This will be achieved with her:
    >
    But now, my user I would like to know if it s possible ask APEX can OPEN some of these files stored on this download of WITHOUT BLOB column.

    My user would like to see a hiperlink (or button) that, if you press on/accessed, can open a new page (or page within the application) with the document. Doesn´t need to edit this file oppened. He wants only to see.
    >

    I hope that helps!
    Kind regards
    Kiran

  • Problem sorting by column &gt; 500 characters in length when NLS_SORT is GENERIC_M

    Hi all

    I ran into this somewhat misleading error message, a DDL, an institution which, when I run a DML statement. What I try to do is, I set everything first NLS_LANGUAGE = NLS_SORT "AMERICAN" = "GENERIC_M" values for the session and then retrieve the data from a table, you place your order by a column called description_value (varchar2 (4000)).

    Like this

    ALTER SESSION SET NLS_LANGUAGE = NLS_SORT "AMERICAN" = "GENERIC_M."

    Select * from tableA by description_value

    The light of the foregoing, I execute via Java, but I am able to run roughly in the same error message in TOAD/PL-SQL developer. The error message is as below,

    ORA-00910: specified length too long for its data type

    _ Some points:

    1. I get this problem only when there are more than 500 record characters with the length of the column description_value. Anything less than 500 characters, I don't get the error message.
    2. when I put the NLS_SORT 'BINARY' or 'FRENCH', I do not run on this issue. The query runs correctly.
    3. I never had this problem in 10 g. This question arose in 11.

    I did a bit of google but din't find any specific reference to anyone else having this problem. Please share your thoughts and comments on this and please let me know if you need more information about it.

    Published by: user13405584 on December 2, 2010 04:20

    Hello

    I was too quick to research. It is indeed wrong. You should read ""Bug 9723547: THE LIMITATION OF the FUNCTION NLSSORT '. " This bug describes the behavior of the NLSSORT and there are bugs in mentioned to correct a wrong implementation of a bug sooner. Because you do not give your exact version of Oracle, take a look and see a patch that you need to correct the false correction of the bug.

    Besides in this bug, it is also clear, documentation was not correct. This is now fixed in the Guide of globalization: kinds of Linguistics [url http://download.oracle.com/docs/cd/E11882_01/server.112/e10729/ch5lingsort.htm#insertedID6], under classification keys. There is the claim that a sort on a kind of multi-langual can be on about 500 characters.

    Read the bug and solutions (patches), and I hope that this becomes clearer.

    Herald tiomela
    http://htendam.WordPress.com

  • I have CS6 and I don't want to break, but I need need CC (mac) installation tips...

    I have a suite CS6 and I don't want to break, but I need CC.

    I don't have time this week for major problems all suite CS6 works very well.

    What is facilities like this news when suite CS6, are they are successful with the latest installers, versions etc.

    Are the facilities problem performing the suites CS, or are isolated problems and problems with the CC?

    I jump into it, or flee?

    Thanks in advance.

    j

    Mac 10.8.5

    Hello J,

    The answer is 'YES '. You can install CS6 and CC on the same machine without causing abreak in the functionality of all the apps CS6.

    Please see KB: http://helpx.adobe.com/creative-cloud/help/install-cc-and-cs6-apps.html

    Kind regards

    Rave

  • I have the table of 3 columns A, B, C. I want to store the sum of columns A B in the C column without using the DML statements. Can anyone help please how to do. ?

    I have the table of 3 columns A, B, C. I want to store the sum of columns A B in the C column without using the DML statements. Can anyone help please how to do. ?

    11.1 and especially you have virtual column

    SQL> create table t
      2  (
      3     a number
      4   , b number
      5   , c generated always as (a+b) virtual
      6  );
    
    Table created.
    
    SQL> insert into t (a, b) values (1, 2);
    
    1 row created.
    
    SQL> select * from t;
    
             A          B          C
    ---------- ---------- ----------
             1          2          3
    

    Before that, a front insert - trigger

    SQL> create table t
      2  (
      3     a number
      4   , b number
      5   , c number
      6  );
    
    Table created.
    
    SQL> create or replace trigger t_default before insert on t for each row
      2  begin
      3    :new.c := :new.a+:new.b;
      4  end;
      5  /
    
    Trigger created.
    
    SQL> insert into t (a, b) values (1, 2);
    
    1 row created.
    
    SQL> select * from t;
    
             A          B          C
    ---------- ---------- ----------
             1          2          3
    
  • How to select the csv data stored in a BLOB column as if it were an external table?

    Hi all

    (Happy to be back after a while! )

    Currently I am working on a site where users should be able to load the data of csv (comma is the separator) of their client machines (APEX 3.2 application) in the Oracle 11.2.0.4.0 EE database.

    My problem is:

    I can't use an external table (for the first time in my life ) so I'm a little clueless what to do as the csv data is stored by the application of the APEX in a BLOB column, and I'm looking for an elegant way (at least SQL PL/SQL/maximization) to insert the data into the destination table (run validations by a MERGER would be the most effective way to do the job).

    I found a few examples, but I think they are too heavy and there could be a more elegant way in Oracle DB 11.2.

    Simple unit test:

    drop table CBC purge;

    drop table dst serving;

    create table src

    (myblob blob

    );

    create table dst

    (num number

    , varchar2 (6) str

    );

    Insert in src

    Select utl_raw.cast_to_raw (1; AAAAAA ;'|| Chr (10) |

    2; BATH; »

    )

    Double;

    Desired (of course) output based on the data in table SRC:

    SQL > select * DST;

    NUM STR

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

    1 ABDELKRIM

    2 BATH

    Does anybody know a solution for this?

    Any ideas/pointers/links/examples are welcome!

    / * WARNING: I was 'off' for about 3 months, then the Oracle - the part of my brain has become a bit "rusty and I feel it should not be so complicated as the examples I've found sofar ' * /"

    Haha, wonder about regexp is like the blind leading the blind!

    However, it's my mistake: I forgot to put the starting position setting (so 1, 2, 3,... was in fact the starting position, not the nth occurrence. duh!)

    So, it should actually be:

    select x.*
    ,      regexp_substr(x.col1, '[^;]+', 1, 1)
    ,      regexp_substr(x.col1, '[^;]+', 1, 2)
    ,      regexp_substr(x.col1, '[^;]+', 1, 3)
    ,      regexp_substr(x.col1, '[^;]+', 1, 4)
    ,      regexp_substr(x.col1, '[^;]+', 1, 5)
    ,      regexp_substr(x.col1, '[^;]+', 1, 6)
    from  src
    ,      xmltable('/a/b'
                  passing xmltype(''||replace(conv_to_clob(src.myblob), chr(10), '')||'')
                  columns
                    col1 varchar2(100) path '.') x;
    

    Note: that's assuming that all the "columns" passed in the string won't be lame.

    If one of them might be null, then:

    select x.*
    ,      regexp_substr(ltrim(x.col1, ';'), '[^;]+', 1, 1)
    ,      regexp_substr(ltrim(x.col1, ';'), '[^;]+', 1, 2)
    ,      regexp_substr(ltrim(x.col1, ';'), '[^;]+', 1, 3)
    ,      regexp_substr(ltrim(x.col1, ';'), '[^;]+', 1, 4)
    ,      regexp_substr(ltrim(x.col1, ';'), '[^;]+', 1, 5)
    ,      regexp_substr(ltrim(x.col1, ';'), '[^;]+', 1, 6)
    from   src
    ,      xmltable('/a/b'
                  passing xmltype(replace(';'||replace(conv_to_clob(src.myblob), chr(10), ';')||'', ';;', '; ;'))
                  columns
                    col1 varchar2(100) path '.') x;
    
  • compress the blob column to save space on the server

    Hi friends,

    I have a problem with the blob column, in the oracle 11.2.0.4 on aix Server database

    I have a table with a blob of column (containing a jpg file). This table is in a tablespace of 300 GB and storage space is full. There is no space on the server (asm).

    I need to load the jpg more in this table, but there is no space.

    I've read a few articles on tha compress blob type column, but I'm not sure what I should do.

    Is it possible to compress the blob column without going to a different tablespace (because the server has no more space to create a new one).

    The table and column have been created in a traditional way.

    Please, advice?

    Best regards

    Dbape.

    But this method requires add-on EA "Adv. Compression" ($$$).

    OP he wanted to compress .jpg files.

    BUDOKAI

    It is not possible.

    the .jpg files are already compressed.

    IIRC (of my Compression Adv. test) - SecureFile "knows best" and will not try to compress BLOBs identified as JPGs or any other known formats of files (such as .zip files)

    In other words - SecureFile is not the OP no good for the type of data, it is try to compress them.

    Are the only solutions that the OP has to enable it to store more JPG images

    • get rid of the old pictures
    • Add more disks
    • resize images (ordimage)
    • recompress the image by reducing the quality as long as the resulting image is unusable (ordimage)

    MK

  • Update the Blob column by replacing a string...

    Hello

    I have a table T1 with a (large binary BLOB) column, I need (you) to update the Blob string with replacement of a chain (in the Blob) with another string.

    The update failed: ORA-00933: not correctly completed SQL command

    CREATE table T1

    (

       ID                   NOMBRE (12)           PAS NULL,

    DELIVERY_CONTENT BLOB ,

    )

    Update   T1 The VALUE DELIVERY_CONTENT = LOB_UTL_PCKG . BLOBREPLACE ()DELIVERY_CONTENT 'old_string' 'new_string'( )

    WHERE ID in (...)

    ORA-00933: SQL not correctly completed command

    I use a function LOB_UTL_PCKG . BLOBREPLACE starting from this package

    CREATE OR REPLACE PACKAGE LOB_UTL_PCKG

    IS

    FUNCTION BLOBREPLACE ()p_blob BLOB p_what VARCHAR2 p_with_what VARCHAR2() RETURN BLOB

    FUNCTION BLOB2CLOB (p_blob BLOB) RETURN CLOB ;

    FUNCTION CLOB2BLOB (p_clob CLOB) RETURN BLOB ;

    END;

    /

    CREATE OR REPLACE PACKAGE BODY LOB_UTL_PCKG

    IS

    FUNCTION BLOBREPLACE ()p_blob BLOB p_what VARCHAR2 p_with_what VARCHAR2()RETURN BLOB 

    IS

    START

    RETURN CLOB2BLOB () REPLACE (BLOB2CLOB()p_blob), p_what p_with_what( ) );

    END BLOBREPLACE ;

    ------------------------------ BLOB2CLOB -------------------------

    FUNCTION BLOB2CLOB (p_blob in BLOB) RETURN CLOB

    IS

       v_clob     CLOB ;

    dest_offset INTEGER := 1 ;

    offset INTEGER := 1 ;

    lang_context INTEGER := DBMS_LOB. DEFAULT_LANG_CTX;

    warning INTEGER ;

    START

    DBMS_LOB. CREATETEMPORARY ( ) v_clob TRUE );

    DBMS_LOB. CONVERTTOCLOB( )

    v_clob ,

    p_blob ,

    DBMS_LOB. LOBMAXSIZE,

    dest_offset ,

    offset ,

    DBMS_LOB. DEFAULT_CSID,

    lang_context ,

    warning

    );

    RETURN v_clob ;

    END BLOB2CLOB ;

    ------------------------------ CLOB2BLOB -------------------------

    FUNCTION CLOB2BLOB (p_clob CLOB) RETURN BLOB

    ACE

       l_blob     BLOB ;

    l_dest_offset INTEGER := 1 ;

    l_source_offset INTEGER := 1 ;

    l_warning INTEGER ;

    lang_context INTEGER := DBMS_LOB. DEFAULT_LANG_CTX;

    START

    DBMS_LOB. CREATETEMPORARY()l_blob TRUE);

    DBMS_LOB. CONVERTTOBLOB( )

    l_blob ,

    p_clob ,

    DBMS_LOB. LOBMAXSIZE,

    l_dest_offset ,

    l_source_offset ,

    DBMS_LOB. DEFAULT_CSID,

    lang_context ,

    l_warning

    );

    RETURN l_blob ;

    END CLOB2BLOB ;

    END;

    /

    Concerning

    Djam

    It works well for me.

    Update T1 SET DELIVERY_CONTENT is LOB_UTL_PCKG. BLOBREPLACE (DELIVERY_CONTENT, 'old_string', 'new_string')

    Where IDSQL > 2 = 1;

    0 lines to date.

  • How to make the image Inline source to read from database BLOB column?

    Dear all

    I have a database table that contains the BLOB column. And tif files in the BLOB column.

    Now, I want to display the value of the BLOB file in af:inlineFrame.

    I want to do this because I installed "AlternateTiff" on my browser to view tif files in the browser.

    You can download it from http://www.alternatiff.com/

    The inLine frame component has a property called 'Source '. The value of the "Source" property must be the location of the URI of the content you want to display in the example of frame.for online:

                          <f:facet name="second">
                                <af:inlineFrame id="if2" styleClass="AFStretchWidth"
                                                shortDesc="To browse the selected document" source="/temp/myFile.tif"/>
    

    now, I want to change this example to read the content of the BLOB column.

    IS this possible?

    Thanks in advance

    You must install a servlet which reads the data from the BLOB and represents the data structure.  My blog http://wp.me/pcBZk-bU shoes how to proceed.

    Timo

  • Stored in the BLOB column display PDF problem

    Hello everyone.

    I tried to follow this tutorial http://asktom.oracle.com/pls/asktom/f?p=100:11:0:p11_question_id:232814159006 on the display of PDF files stored in BLOB columns. This is done on Apex 4.2, with my DB 11 g running. I have my procedure, which I will post below:
    create or replace procedure "PDF" (p_id IN gvo_documents.doc_id%type)
    is
        l_lob    blob;
        l_amt    number default 30;
        l_off   number default 1;
        l_raw   raw(4096);
    begin
        select contents into l_lob
            from gvo_documents 
             where doc_id = p_id;
    
     -- make sure to change this for your type!
        owa_util.mime_header( 'application/pdf' );
    
    
        begin
            loop
              dbms_lob.read( l_lob, l_amt, l_off, l_raw );
              htp.prn( utl_raw.cast_to_varchar2( l_raw ) );
              l_off := l_off+l_amt;
              l_amt := 4096;            
        end loop;
            exception
               when no_data_found then 
                  NULL;
            end;
    
    end;
    
    I am trying to run this through a region dynamic PL/SQL, and even if I don't get any error, the content displayed is a huge mess of truncated text and strange characters. I tried to run this procedure on many other types of documents, including word and jpeg image files, all with the necessary changes in my inside, and regardless of what I use, I always get a big mess of strange characters. Does anyone have information or ideas why this is happening?

    If I understand correctly, your needs must be broken down into two problems:
    1) click the link that opens a window showing a new APEX page
    (2) an APEX page displays the document, download it not.

    I did not (yet) #1.
    However, you can generate a URL that points to the new page in the select for the report.

    It's a related issue, but no response yet:
    Open the pdf file in the browser window

    The key is to target = "_blank" to the anchor tag.
    To generate the URL, you must use the APEX_UTIL.prepare_URL () function.

    If this does not work, a dynamic Action that makes magical things of JavaScript may be necessary.

    # 2, I lost the URL that showed how to display a PDF file in a page "form.
    From what I remember:
    Start with a blank page with a pristine area of HTML (all items will in the HTML area)
    Add an element to the PK/annual
    part I forgot Create a Data Manipulation process
    -Automated row Fetch
    -By loading - after the header
    -(stuff for your table/view)
    part I forgot Create a (I think) "File browser" item type. For the parameters:
    -Storage of Type "BLOB column specified in the Source element" (and put the name of the BLOB column)
    -MIME Type column: (column name) - since there are several types, this is a MUST HAVE
    -Filename column: (column name) - I highly recommend you have this.
    -Provision of content is INLINE<-- this="" is="" the="">

    In addition, you will need a browser for each of the Types MIME Plugin (if not, the browser may try to "Download" the file)
    Browsers can manage the types of images internally. Plugin Adobe can handle PDF files. I do not know Word/Excel.

    Yet once again, I don't remember the exact details, but that should cover most of it.

    MK

  • How to stop the blob column don't affect display performance.

    Hello
    I have an external table that has a blob column. The table has at present about 40 recordings that the blob column is reading in some 150 MB total records. When I try to view the external table performance is terrible, takes to always display the table. I thought far around from this would be to create a view that would leave the blob column, in an attempt to show folders quickly, but it has no impact on performance.

    Is it possible to create the view that returns the columns I want quickly for these 40 weird files?

    Ben

    Benton says:
    Hello
    I have an external table that has a blob column. The table has at present about 40 recordings that the blob column is reading in some 150 MB total records. When I try to view the external table performance is terrible, takes to always display the table. I thought far around from this would be to create a view that would leave the blob column, in an attempt to show folders quickly, but it has no impact on performance.

    Is it possible to create the view that returns the columns I want quickly for these 40 weird files?

    Ben

    You can try to create 2 external tables out of this file, without the BLOB column and another containing the BLOB column.

    Then query the external table BLOBless when you have no need for the BLOB.

  • Should be a simple question: How do I search for properties of the BLOB columns?

    Hi people,

    It's just out of my mind. How can I get a BLOB properties using the query?

    I have a table with a BLOB column where documents are stored. I would like to get information on the size of each BLOB content.
    SQL> desc document
    Name              Type          Nullable Default Comments 
    ----------------- ------------- -------- ------- -------- 
    OBJECT_ID         NUMBER                                  
    TIMESTAMP         DATE                   sysdate          
    TITLE             VARCHAR2(200) Y                         
    DOCUMENT_TYPE     NUMBER        Y                         
    DOCUMENT_FILENAME VARCHAR2(200) Y                         
    DOCUMENT_TEXT     BLOB          Y   
    How to find the DOCUMENT_TEXT properties (size)?

    Thank you
    Tomas
    dbms_lob.getlength(document_text)
    
  • Store the output XML editor in the database blob column

    Hello

    We have a requirement to store the pdf files generated by several applications simultaneous xml editor in a database blob column, so that they can be recovered later, whenever required by the user. As far as we know, publisher concurrent request XML output files are stored on the node of simultaneous treatment and the location of the file does not exist in the FND_CONCURRENT_REQUESTS table. But these files to purge from time to time. We are therefore looking for a solution to store these files in the database to the display if necessary.

    If someone knows a solution or can point me to the right direction, it would be much appreciated.

    Thank you very much
    Mary

    Hi Mary,

    You must load the PDF files in the database. Write a regular competitor program which monitors fnd_concurrent_requests and load a custom table or fnd_lobs with any editor of BI exit function application concurrent reading files. BI Publisher output files according to naming convention, so easy to find. http://garethroberts.blogspot.com/2008/07/where-do-i-get-XML-file-or-request.html

    Kind regards
    Gareth

  • How to create table containe blob column view?

    Hi, I would like to aske any type of blob data
    I have data containe blob clolumn type table

    I want to create view this table how do?
    and


    If I created the table view blob column data will be responsible for memory or what because that will cause some performance issues because the table contains enormous data?


    Thank you

    You must create the view as

      CREATE OR REPLACE VIEW 
      AS
         SELECT col1, col2, col3.....
         FROM    
         WHERE   
         ...etc...
    

    The Act of creating the view will not otherwise the data in the table underlying, all it will do is create a view definition.
    Select only the view will select data.

    If you don't need to select the BLOB column in the view, then you would not include it in the list of the columns in the view definition.
    If your LOB data are stored online, then it may be a significant selection of the view, even if the BLOB column is not indicated in the list of the columns in the view.

    Published by: dombrooks on June 1, 2009 10:12

Maybe you are looking for

  • Cannot install iOS 10.0.1 with Apple Configurator 1.7.2

    Hello I have 60 iPads in 5 carts (12 per basket) that I need to install some applications on. They are already configured and supervised with Apple Configurator 1.7.2. I've never had problems in the past with AC1, I've always been able to install the

  • Faulty motherboard Satellite A300

    Hello I m wondering if anyone can help me. I got the Toshiba Satellite A300-1bz for 18 to 20 months now, and he collapsed. Warranty was only for 1 year then I m still have to pay the Bill. I was told the motherboard needs replacement? When you turn i

  • Dear Matt, answer my question.

    Answer this question: https://forums.Motorola.com/posts/4fa205da90?commentId=795974#795974

  • G3-605 &amp; SLI?

    Hello. Sorry if this has already been covered. I have G3-605 and I was wondering if it is possible to add two completely new cards vga in sli? See you soon.

  • Installing a version of Windows 7 on a laptop which the CPU speed is 1.73 GHz?

    Hello Can I install a version of windows 7 on a laptop with these specs: Intel@Celeron @ 530 processor (1.73 GHz, 533 MHz FSB, 1 MB L2 Cache) Mobile Inter @ Graphics Media accelerator X 3100 512 MB DDR2