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

Tags: Database

Similar Questions

  • image not displayed programmtically stored in the blob column

    Hello

    I modified the student table to store photos of students. To do this, I added STIMG as BLOB, FILENAME, MIMETYPE, IMAGE_LAST_UPDATE COLUMNS in the studentadmitted table. Image stored and displayed in the report very well. With the following query

    Select "ROWID",.
    "ST_ID."
    "FIRST NAME",
    'NAME',
    "FFIRST_NAME,"
    "FLAST_NAME,"
    "COURSE_ID."
    'SESSION_ID '.
    "CONTACT #" "CONTACT_H", nvl ((STIMG) dbms_lob.getlength, 0) IMAGE.
    of ' #OWNER # '. " STUDENTADMITTED ".
    Images are displayed in the column, but they have different sizes.

    To control this, I changed the query like this

    Select "ROWID",.
    "ST_ID."
    "FIRST NAME",
    'NAME',
    "FFIRST_NAME,"
    "FLAST_NAME,"
    "COURSE_ID."
    'SESSION_ID '.
    "CONTACT # ' 'CONTACT_H', decode (nvl (dbms_lob.getlength (stimg), 0), 0, null,)
    "< img style =" border: 4px solid #CCC; " -moz-border-radius: 4px; -webkit - border-radius: 4px; » '||
    "src =" "|
    apex_util.get_blob_file_src ('P16_stIMG', st_id) |
    ("height ="75"width ="75"alt ="Image of the product"title ="Product Image"/ > ')
    detail_img
    of ' #OWNER # '. " STUDENTADMITTED ".

    No report with the following error,

    error report: ORA-06502: PL/SQL: digital or value error: character of number conversion error

    Win Server 2008
    Oracle database: 11G R2
    Apex Ver: 4.2

    Sanna

    Hey Sajjad,

    Try this, the last code change.
    I tried it works next to me.

    Select "ROWID",.
    "ST_ID."
    "FIRST NAME",
    'NAME',
    "FFIRST_NAME,"
    "FLAST_NAME,"
    "COURSE_ID."
    'SESSION_ID '.
    "CONTACT #" "CONTACT_H."
    decode (nvl (dbms_lob.getlength (STIMG), 0), 0, null, "") AS IMAGE,.
    "MIME TYPE"
    "FILENAME."
    'IMAGE_LAST_UPDATE '.
    of ' #OWNER # '. " STUDENTADMITTED ".

    Kind regards
    Jitendra

  • 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

  • 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.

  • 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

  • Interactive report will not save the BLOB column attributes

    I created several interactive reports with the 4.0 and 4.1 which had columns of type BLOB with no problems and the download link worked fine. After 4.2 update, interactive reports get the following error when you click on the download link:
    Not found
    The requested URL /apex/apex_util.get_blob was not found on this server

    If I open the edit page of the report, the BLOB downloads very well. When I looked at the report in detail the attributes of the BLOB column, I noticed that the BLOB column attributes had not been met. I tried several times to fill in (name of the Table column name, Primary Key, MIMETYPE, etc), but after applying changes and reopen the attributes page for the blob column, the values, that I entered is not saved.
    For completeness, here is the select statement for the report:
    Select "DESC_ATT_ID."
    "BR_ID,"
    "FILENAME."
    "MIME TYPE"
    DBMS_LOB. GetLength ("DESC_ATTACHMENT") 'DESC_ATTACHMENT '.
    of ' #OWNER # '. " ALTEC_BR_DESC_ATT ".
    WHERE BR_ID =: P3_BR_ID

    Also, here is the value for the number/Date of the BLOB column format:
    DOWNLOAD: ALTEC_BR_DESC_ATT:DESC_ATTACHMENT:DESC_ATT_ID

    Can someone tell me please in the right direction to get the link to the interactive report work correctly?
    Thank you very much
    Jerry

    Hello
    How about you, you do not format BLOB column, do you it manually like this example here:

    Apex. Oracle.com
    workspace: somefeto
    user: test
    PWD: test
    Application 63066

    in the same workspace, there is Sample File Upload and Download (App ID 10540), and it works very well...

    If not, Pls, reproduce the problem on apex.oracle.com

    Best regards
    Fateh
    ------
    If you believe that my answer is correct or helpful to you pls, then mark the reply as useful or correct

  • Prepare a document to insert a row that contains the Blob column. Is what sense this correct?

    When we prepare the statement to insert a row that contains the Blob column. Is what sense this correct? And what is the difference? Does anyone know?

    1 Preparestatement.setBlob(parameter number, blob type object)

    2 Preparestatement.setBlob(parameter number, inputstream type object)

    This link shows the test I did.

    https://community.Oracle.com/thread/3680185?SR=Inbox & customTheme = OTN

    When we prepare the statement to insert a row that contains the Blob column. Is what sense this correct? And what is the difference? Anyone know?

    1 Preparestatement.setBlob(parameter number, blob type object)

    2 Preparestatement.setBlob(parameter number, inputstream type object)

    I answered in your other thread and provided a link to the JDBC Dev Guide section, which explains how to work with type LOB and BFILE data.

    Have you read this article from doc?

    Did you read my response to your other thread?

    In java, a BLOB is just the index that gives you access to the content. In your case, you access by selecting a locator BLOB existing and getting his inputstream. This inputstream is what allows you to access the content real blob.

    The Locator is just that; It specifies the LOCATION of the blob content, but NOT the content.

  • 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;
    
  • How to display image in the data from the blob column item

    Hello
    This is pavan, I try to upload images in the tables and display.
    I was able to download the data in the table using this http://www.apexninjas.com/blog/2011/09/uploading-and-displaying-images-in-apex/
    but I'm unable to display in the report or item and also I have mentioned these http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35127/apex_util.htm#AEAPI129 post but I din't get how to put an element valid POINT with the type of FILE that contains the type of source of column DB application page name.
    and also, I raised the thread https://community.oracle.com/message/9616066that also in response that he has changed the type of data that we need I don't have.
    can someone help me on this please
    Kind regards
    Pavan

    creating manual p3_image point of page that is display in form of image display and check point p3_image for more information how image

    in your application.

    Leave.

  • delete the blob column

    Hey all,.
    I have these tables:
    Products
    CREATE TABLE "COMPDB"."PRODUCTS" 
       (     "PRO_ID" NUMBER NOT NULL ENABLE, 
         "PRO_NAME" VARCHAR2(40 BYTE) NOT NULL ENABLE, 
         "COMPETITOR" NUMBER NOT NULL ENABLE, 
         "CATEGORY" NUMBER NOT NULL ENABLE, 
         "INS_USER" VARCHAR2(50 BYTE), 
         "UPD_USER" VARCHAR2(50 BYTE), 
         "INS_DATE" DATE, 
         "UPD_DATE" DATE, 
         "VERSION" NUMBER, 
         "PHOTO" BLOB, 
         "FILENAME" VARCHAR2(255 BYTE), 
         "MIMETYPE" VARCHAR2(255 BYTE), 
         "LAST_UPDATE_DATE" DATE, 
          CONSTRAINT "PRODUCT_PK" PRIMARY KEY ("PRO_ID")
      USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE "COMPDB"  ENABLE, 
          CONSTRAINT "PRO_CAT_FK" FOREIGN KEY ("CATEGORY")
           REFERENCES "COMPDB"."CATEGORY" ("CAT_ID") ON DELETE CASCADE ENABLE, 
          CONSTRAINT "PRO_COMP_FK" FOREIGN KEY ("COMPETITOR")
           REFERENCES "COMPDB"."COMPETITORS" ("COMP_ID") ON DELETE CASCADE ENABLE
       ) SEGMENT CREATION IMMEDIATE 
      PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE "COMPDB" 
     LOB ("PHOTO") STORE AS BASICFILE (
      TABLESPACE "COMPDB" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION 
      NOCACHE LOGGING 
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) ;
     
    
      CREATE OR REPLACE TRIGGER "COMPDB"."TRG_PRODUCTS_BRI" BEFORE
      INSERT ON PRODUCTS REFERENCING OLD AS OLD NEW AS NEW FOR EACH ROW BEGIN IF :NEW.PRO_ID IS NULL THEN
      SELECT PRODUCTS_SEQ.NEXTVAL INTO :NEW.PRO_ID FROM DUAL;
    END IF;
    :NEW.INS_USER := NVL(:NEW.INS_USER,Comm_Usermanagement.Get_Username);
    :NEW.INS_DATE := sysdate;
    :NEW.UPD_USER := NVL(:NEW.UPD_USER,Comm_Usermanagement.Get_Username);
    :NEW.UPD_DATE := sysdate;
    :NEW.VERSION  := NVL(:NEW.VERSION,0);
    END;
    /
    ALTER TRIGGER "COMPDB"."TRG_PRODUCTS_BRI" ENABLE;
     
    
     CREATE OR REPLACE TRIGGER "COMPDB"."TRG_PRODUCTS_BRU" BEFORE
     UPDATE ON PRODUCTS REFERENCING OLD AS OLD NEW AS NEW FOR EACH ROW BEGIN IF NOT UPDATING ('UPD_USER')
     OR :NEW.UPD_USER IS NULL THEN :NEW.UPD_USER := Comm_Usermanagement.Get_Username;
    END IF;
    IF NOT UPDATING ('UPD_DATE') OR :NEW.UPD_DATE IS NULL THEN
      :NEW.UPD_DATE                               := sysdate;
    END IF;
    IF NOT UPDATING ('VERSION') THEN
      :NEW.VERSION := :OLD.VERSION + 1;
    END IF;
    END;
    /
    ALTER TRIGGER "COMPDB"."TRG_PRODUCTS_BRU" ENABLE;
    Competitors:
      CREATE TABLE "COMPDB"."COMPETITORS" 
       (     "COMP_ID" NUMBER NOT NULL ENABLE, 
         "COMP_NAME" VARCHAR2(40 BYTE) NOT NULL ENABLE, 
         "INS_USER" VARCHAR2(50 BYTE), 
         "UPD_USER" VARCHAR2(50 BYTE), 
         "INS_DATE" DATE, 
         "UPD_DATE" DATE, 
         "VERSION" NUMBER, 
          CONSTRAINT "COMPETITOR_PK" PRIMARY KEY ("COMP_ID")
      USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE "COMPDB"  ENABLE
       ) SEGMENT CREATION IMMEDIATE 
      PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE "COMPDB" ;
     
    
      CREATE OR REPLACE TRIGGER "COMPDB"."TRG_COMPETITORS_BRI" BEFORE
      INSERT ON COMPETITORS REFERENCING OLD AS OLD NEW AS NEW FOR EACH ROW BEGIN IF :NEW.COMP_ID IS NULL THEN
      SELECT COMPETITORS_SEQ.NEXTVAL INTO :NEW.COMP_ID FROM DUAL;
    END IF;
    :NEW.INS_USER := NVL(:NEW.INS_USER,Comm_Usermanagement.Get_Username);
    :NEW.INS_DATE := sysdate;
    :NEW.UPD_USER := NVL(:NEW.UPD_USER,Comm_Usermanagement.Get_Username);
    :NEW.UPD_DATE := sysdate;
    :NEW.VERSION  := NVL(:NEW.VERSION,0);
    END;
    /
    ALTER TRIGGER "COMPDB"."TRG_COMPETITORS_BRI" ENABLE;
     
    
      CREATE OR REPLACE TRIGGER "COMPDB"."TRG_COMPETITORS_BRU" BEFORE
      UPDATE ON COMPETITORS REFERENCING OLD AS OLD NEW AS NEW FOR EACH ROW BEGIN IF NOT UPDATING ('UPD_USER')
      OR :NEW.UPD_USER IS NULL THEN :NEW.UPD_USER := Comm_Usermanagement.Get_Username;
    END IF;
    IF NOT UPDATING ('UPD_DATE') OR :NEW.UPD_DATE IS NULL THEN
      :NEW.UPD_DATE                               := sysdate;
    END IF;
    IF NOT UPDATING ('VERSION') THEN
      :NEW.VERSION := :OLD.VERSION + 1;
    END IF;
    END;
    /
    ALTER TRIGGER "COMPDB"."TRG_COMPETITORS_BRU" ENABLE;
     
    Category
     
    
      CREATE TABLE "COMPDB"."CATEGORY" 
       (     "CAT_ID" NUMBER NOT NULL ENABLE, 
         "CAT_NAME" VARCHAR2(40 BYTE) NOT NULL ENABLE, 
         "INS_USER" VARCHAR2(50 BYTE), 
         "UPD_USER" VARCHAR2(50 BYTE), 
         "INS_DATE" DATE, 
         "UPD_DATE" DATE, 
         "VERSION" NUMBER, 
          CONSTRAINT "CATEGORY_PK" PRIMARY KEY ("CAT_ID")
      USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE "COMPDB"  ENABLE
       ) SEGMENT CREATION IMMEDIATE 
      PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE "COMPDB" ;
     
    
      CREATE OR REPLACE TRIGGER "COMPDB"."TRG_CATEGORY_BRI" BEFORE
      INSERT ON CATEGORY REFERENCING OLD AS OLD NEW AS NEW FOR EACH ROW BEGIN IF :NEW.CAT_ID IS NULL THEN
      SELECT CATEGORY_SEQ.NEXTVAL INTO :NEW.CAT_ID FROM DUAL;
    END IF;
    :NEW.INS_USER := NVL(:NEW.INS_USER,Comm_Usermanagement.Get_Username);
    :NEW.INS_DATE := sysdate;
    :NEW.UPD_USER := NVL(:NEW.UPD_USER,Comm_Usermanagement.Get_Username);
    :NEW.UPD_DATE := sysdate;
    :NEW.VERSION  := NVL(:NEW.VERSION,0);
    END;
    /
    ALTER TRIGGER "COMPDB"."TRG_CATEGORY_BRI" ENABLE;
     
    
      CREATE OR REPLACE TRIGGER "COMPDB"."TRG_CATEGORY_BRU" BEFORE
      UPDATE ON CATEGORY REFERENCING OLD AS OLD NEW AS NEW FOR EACH ROW BEGIN IF NOT UPDATING ('UPD_USER')
      OR :NEW.UPD_USER IS NULL THEN :NEW.UPD_USER := Comm_Usermanagement.Get_Username;
    END IF;
    IF NOT UPDATING ('UPD_DATE') OR :NEW.UPD_DATE IS NULL THEN
      :NEW.UPD_DATE                               := sysdate;
    END IF;
    IF NOT UPDATING ('VERSION') THEN
      :NEW.VERSION := :OLD.VERSION + 1;
    END IF;
    END;
    /
    ALTER TRIGGER "COMPDB"."TRG_CATEGORY_BRU" ENABLE;
    Now my problem:
    To remove the blob (content) column in the products and the columns, which belong to this column (Filename, Mimetype, Last_update_date).
    EMPTY_BLOB() does not work :-/
    as the null value.

    I can always download the file, although I can see null in this column in sql developer.


    I hope someone can help.

    Locke90210 wrote:

    I can always download the file, although I can see null in this column in sql developer.

    I hope someone can help.

    What code did you use to set the null values?
    Have you clicked on the button "validation"?

    (and, Yes, this should be in the SQL forum)

    MK

  • 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)
    
  • 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.

  • Interactive report - how to set the default columns displayed

    Env: APEX 4.1

    For example, at the beginning, I created the reprot source as select c1, c2, c3 from t; later, I added c4. But I was unable to figure out how to do c1, c2, c3, c4 become the columns displayed default. I always have to click on Action-> select columns, and then move the C4 "do not display" to "report view". Any clue?

    Thank you
    Denis

    After choosing the columns (and the other changes you want)

    go to Actions > save the report > save as default report > primary, click [apply]

    I am on 4.1.1.00.23 and simply exercised these steps successfully with one of my IR

    If this does not work, I don't know what else to say. (If you are not connected to the Application Builder, you don't not even the default save option)

  • How to insert data into the BLOB column

    Hi all

    Can someone help me to insert data in the BLOB data type column?

    The structure of the table is
    CREATE TABLE XXATFL_DM_FORCAST_STG
    (
    TASK_ID NUMBER,
    USER_ID NUMBER,
    CREATED_BY NUMBER (15),
    CREATION_DATE DATE,
    LAST_UPDATED_BY NUMBER (15),
    DATE OF LAST_UPDATE_DATE,
    LAST_UPDATE_LOGIN NUMBER (15),
    RECORD_STATUS VARCHAR2 (1 BYTE),
    ERROR_MESSAGE VARCHAR2 (4000 BYTE),
    DATA_FILE BLOB
    )

    I want to insert data into the column DATA_FILE. and this insert statement inside a procedure.

    Please help me as soon as possible because it is very urgent for me

    Thank you and best regards,
    Charrier

    Charrier,

    If you form the string yourself, you can use the function utl_raw.cast_to_raw on your channel.

    http://download.Oracle.com/docs/CD/B12037_01/AppDev.101/b10802/u_raw.htm#997086

    sql> create table t(
      2    id number,
      3    l_blob blob
      4  );
    
    sql> insert into t values(1, utl_raw.cast_to_raw('SampleString'));
    
    1 row created.
    
    sql> commit;
    
    Commit complete.
    
  • calculate the sum of the two columns - display the result in the third column

    Hello

    I have a report and I want to calculate the sum of the two columns of the report and display the total in the third column.

    For example: Sample_My_Report

    Col1 Col2 (Col1 and Col2) Total

    3-7-10


    can someone help me with this question.

    Thank you.

    Hello:

    If your report is an IR you can use the menu "Tool" to add columns calculated at the State

    CITY

Maybe you are looking for

  • Paste the password disabled on some Web sites

    Hello, I use an encrypted password manager to store and to create unique and complex passwords. Since these passwords are not insignificant, I use the function copy/paste of the Manager to stick in the fields password for different websites. Password

  • Preview of the scanned image is good but once saved image is black with horizontal lines

    My OS is: OSX 10.9.3 I have a HP Photosmart Premium series - C309g all-in-one machine. This machine worked well. Print is good. Copy is good. But now I have some analysis of the issues, probably due to an update of the OS. Problem: Preview of the sca

  • Scrolling the mouse will pass only volume in the mixer volume if flying over directly.

    By clicking on the mixer volume bottom right of your taskbar displays the master volume mixer. Normally once you do this, you can adjust the volume by using the scroll wheel on your mouse whenever your mouse is on the desktop. In my case this works i

  • Windows 7 installs due to the error of the BIOS

    I just bought Windows 7 and was able to download without a problem, when I get to the part of the Installation it comes up with an error message saying that I need to update my BIOS. I tried to look up places to download and followed other forums but

  • Any concerns of connection VPN security issue.

    Hi guys,. I set up a VPN on Cisco ASA & our mobility users are able to connect VPN successfully and access my LAN environment but our senior management says there provide less security & any hacker can hack easily. Someone can help me on this point,