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.

Tags: Database

Similar Questions

  • Update a BLOB column

    Hello

    I have Oracle XE 11.2.0 loaded on a Windows Server.  It works very well.  I use Apex 4.1 on break as well.

    In a table, I have a column (LIST_FILE) that contains the name of a file and does not include the file extension.  Recently, I added a BLOB (LIST_PDF) column to this table.

    I would like to create SQL to update each row of this table by inserting PDF file into the blob.  For each row in the table, there is a file beginning with value in LIST_FILE and followed by a period and PDF (.) (PDF).  File1.PDF, File2, PDF, etc.  The windows directory that contains the PDF files can be moved anywhere on the windows server.

    How to build the SQL to update the BLOB column?

    Thanks for your help.

    Hi, PhilMan2

    You cannot load the PDF by single SQL. It must be the script on PL/SQL. Visit this link to find out how you can make your task How to insert blob in the database file

    ---

    English is not my mother tongue; Please forgive my faults

  • 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

  • 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

  • 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

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

  • Identify the weekend and the days of the week a date and update the empty column

    Hi, I look at previous posts that are similar to my question, but nothing helps.

    I have a column called incident_date that is in this format and comes from the Nov_Final table
    01-JUL-2009 20.10
    04-NOV-2009 17.00
    16-DEC-2009 16.00
    In Nov_Final, I created a column called weekend

    What I want to do is to perform an update, something like this:
    Update Nov_Final
    
    SET Weekend=(case when Incident_date ='WEEKEND' THEN 'Y' ELSE 'N' END)
    Banner:
    Oracle Database 11 g Release 11.2.0.2.0 - 64 bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    "CORE 11.2.0.2.0 Production."
    AMT for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    Weekend would be Saturday or Sunday. 
    In short I need to find out if the incident_date falls on a weekend and if it does update the weekend column as 'Y' else 'N' if it's not.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

    You can use TO_CHAR function with a format mask as "fmDAY" to your needs:

    with t_data
    as
    (
    select sysdate + level as col1 from dual connect by level <= 7
    )
    SELECT
        col1,
        TO_CHAR(col1,'fmDAY') col_day,
        CASE
            WHEN TO_CHAR(col1,'fmDAY') IN ('SATURDAY','SUNDAY')
            THEN 'Y'
            ELSE 'N'
        END AS weekend_ind
    FROM
        t_data;
    
    COL1                      COL_DAY                     WEEKEND_IND
    ------------------------- --------------------------- -----------
    08-NOV-11 07:54:12        TUESDAY                     N
    09-NOV-11 07:54:12        WEDNESDAY                   N
    10-NOV-11 07:54:12        THURSDAY                    N
    11-NOV-11 07:54:12        FRIDAY                      N
    12-NOV-11 07:54:12        SATURDAY                    Y
    13-NOV-11 07:54:12        SUNDAY                      Y
    14-NOV-11 07:54:12        MONDAY                      N           
    
    7 rows selected
    
  • 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.

  • 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

  • Classic generic column report - update the list column

    Consider a dynamic pivot statement as follows (as described by the AMIS) which

    select * from table( pivot(  'select deptno,  job, count(*) c from scott.emp group by deptno,job' ) )
    
    
    
    

    I used this as a SQL source for the classic report, by selecting "use generic column names.

    The report looks like

    dp_full.png

    I can set up the data displayed with a selection list and including a clause where clause

    where job =v(''P39_JOB'') or v(''P39_JOB'') is null
    
    
    
    

    List select not PPR on the region,demonstrated here:

    https://Apex.Oracle.com/pls/Apex/f?p=73000:39:

    Note: , and all swivel jobs are still visible in the form of columns, data is limited

    -other jobs are empty

    -departments with no clerks are not shown

    dp_clerk.png

    Let's say you have another list of selection than the work of groups, say the "Présidents" and "close".

    How can you update the region to exclude certain jobs?

    Reload the page with the value of P39_JOB already set will not affect the result, while including a literal string made.

    It seems maybe ODCI function analyzes the query on Lees null, and then fills with actual results.

    Does anyone have any suggestions?

    Update: it seems a workaround is to inject the value as a substitution string, for example:

    and employment as ' & P39_CEO. »

    where P39_CEO is lacking in session state %

    I've only had this concept works in my client application (4.2, 11 2 GR), not my demo (5.0, 12 c), to even try to meet the relevant quotes and when null. I kept getting

    error report: ORA-1403: no data found

    I could not work how to correctly apply sys.dbms_assert.enquote_literal)

    Scott

    Hi Scott

    What approach I described in this post: matrix report?

    It eliminates the need for any dynamic SQL and I think filtering options might be implemented using SQL/XML features.

  • Error updating a blob column

    Hello Hello everyone,

    first I created the directory images like "C:\images".

    then I created the table PRICUSTOMERPROOF

    Name of Type Null

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

    CUSTOMERID VARCHAR2 (50)

    IMAGEID NUMBER

    NUMBER OF IDTYP

    IDVALUE VARCHAR2 (50)

    IDEXPDATE TIMESTAMP (6)

    IDIMAGE BLOB

    ACTIVEC NUMBER (1)

    USERR VARCHAR2 (10)

    DATED TIMESTAMP (6)

    DEFAULTC NUMBER (1)

    NUMBER OF CUSTOMERIDENTIFICATIONID

    then I inserted all the values in the table except column IDIMAGE

    then I tried to update the column with

    DECLARE

    l_bfile BFILE.

    l_blob BLOB;

    BEGIN

    SELECT IDIMAGE

    IN l_blob

    OF PRICUSTOMERPROOF

    WHERE CUSTOMERID = "Pri29098."

    UPDATE;

    l_bfile: = BFILENAME (upper ('images'), "Tulips.jpg");

    DBMS_LOB. FileOpen (l_bfile, Dbms_Lob.File_Readonly);

    DBMS_LOB. LoadFromFile (l_blob, l_bfile, DBMS_LOB.getlength (l_bfile));

    DBMS_LOB. FileClose (l_bfile);

    END;

    When I run the codes I get

    Error report:

    ORA-22285: non-existent directory or file for FILEOPEN operation

    ORA-06512: at "SYS." DBMS_LOB", line 805

    ORA-06512: at the level of line 12

    22285 00000 - 'non-existent directory or file %s operation '.

    * Cause: Attempted access to a directory that does not exist, or attempted

    to access a file in a directory that does not exist.

    * Action: To ensure that an appropriate system specified

    the directory exists in the data dictionary, or

    Make sure that the name is correct.

    im sure that the directory of the image exists. can someone help me get errors deleted

    thanking you

    Prakash

    Good; After the granting of privileges, it is a different matter! To do this, you will need to initialize the variable of type blob with a value of type blob (use empty_blob()). Try it

    DECLARE
    l_bfile BFILE.
    l_blob BLOB;

    BEGIN
    / * commented
    SELECT IDIMAGE FROM l_blob
    OF PRICUSTOMERPROOF
    WHERE CUSTOMERID = "Pri29098."
    UPDATE; */
     
    Update pricustomerproof set idimage = empty_blob()
    where customerid = "Pri29098."
    return idimage in l_blob;
     
    l_bfile: = BFILENAME (upper ('images'), "Tulips.jpg");
    DBMS_LOB. FileOpen (l_bfile, dbms_lob.file_readonly);
    DBMS_LOB. LoadFromFile (l_blob, l_bfile, dbms_lob.getlength (l_bfile));
    DBMS_LOB. FileClose (l_bfile);
     
    commit;
    END;
    /

  • 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.
    
  • update the column of type char to stem after insert or update the same column

    I have the table "people":

    DESC PEOPLE
    Name Null? Type
    ------------------------------- -------- ------------
    ID NOT NULL NUMBER
    NAME VARCHAR2 (25) NOT NULL

    and I need to make sure that the NAME column is always in uppercase letters, so I did as he illustrated in this link:
    http://asktom.Oracle.com/tkyte/mutate/

    I did this: -.
    ==================================
    CREATE OR REPLACE TRIGGER parent_bi
    BEFORE THE INSERT OR UPDATE
    ON people
    BEGIN
    state_pkg.newrows: = state_pkg.empty;
    END;
    /
    -----------------------------------------------------------------
    CREATE OR REPLACE TRIGGER parent_aifer
    AFTER INSERT OR UPDATE
    ON PEOPLE
    FOR EACH LINE
    BEGIN
    state_pkg.newrows (state_pkg.newrows.COUNT + 1): =: NEW. ROWID;
    END;
    /
    ------------------------------------------------------------------
    CREATE OR REPLACE TRIGGER HR. PARENT_AI
    AFTER INSERT OR UPDATE
    ON HUMAN RESOURCES. PEOPLE
    REFERRING AGAIN AS NINE OLD AND OLD
    FOR EACH LINE
    BEGIN
    BECAUSE me in 1... state_pkg.newrows.count
    LOOP
    UPDATE of the people
    NAME = UPPER (NAME)
    People WHERE. ROWID = state_pkg.newrows (i);
    END LOOP;
    END;
    /
    ======================================

    but nothing is coming, as the same that these triggers do not exist.

    So, what is wrong?
    and how I workaround to make this statement:-
    Setting a DAY people SET NAME = UPPER (NAME);
    whenever I update or insert in the name column.

    It is much simpler that that - you just need a BEFORE INSERT trigger

    CREATE OR REPLACE TRIGGER your_trigger_name
      BEFORE INSERT OR UPDATE ON persons
      FOR EACH ROW
    BEGIN
      :new.name := UPPER( :new.name);
    END;
    /
    

    As you can see from this example, which will force all uppercase

    SQL> create table persons (
      2    name varchar2(10)
      3  );
    
    Table created.
    
    SQL> CREATE OR REPLACE TRIGGER your_trigger_name
      2    BEFORE INSERT OR UPDATE ON persons
      3    FOR EACH ROW
      4  BEGIN
      5    :new.name := UPPER( :new.name);
      6  END;
      7  /
    
    Trigger created.
    
    SQL> insert into persons values( 'justin' );
    
    1 row created.
    
    SQL> insert into persons select lower(ename) from emp;
    
    14 rows created.
    
    SQL> select * from persons;
    
    NAME
    ----------
    JUSTIN
    SMITH
    ALLEN
    WARD
    JONES
    MARTIN
    BLAKE
    CLARK
    SCOTT
    KING
    TURNER
    ADAMS
    JAMES
    FORD
    MILLER
    
    15 rows selected.
    

    Also, you generally want to add a check constraint to ensure that NAME = UPPER (NAME).

    Justin

  • Load the BLOB column in Oracle to an Image column in MS SQL Server

    Hello
    I have an Oracle table as the source and a MS SQL Server table as a target. A blob column (4000) in the source is mapped to a column (2147483647) Image in the target.
    Execution will give me the error message "* java.lang.NumberFormatException: for the input string:"4294967295"*"when it comes to step 'load the data into the staging of table' '.
    The LKM that I use is LKM SQL for MSSQL.

    I also tried LKM SQL for MSSQL (BULK), LKM SQL for SQL (jython), LKM SQL for SQL. None of them are useful.

    Impossible, someone tell me how to fix this 4294967295? Thank you very much

    Hi Yang,

    Oracle recommends the setting of the 'get_lob_precision' false flag to avoid this error.

    For this,.

    1. make a backup of your ODIPARAM. BAT file.
    2. open ODIPARAM. BAT file and add the following line.

    Set ODI_ADDITIONAL_JAVA_OPTIONS = % ODI_ADDITIONAL_JAVA_OPTIONS % ""-Doracledatabasemetadata.get_lob_precision = false ' "

    Next to

    Set ODI_ADDITIONAL_JAVA_OPTIONS = ""-Djava.security.policy = server.policy ' "

    PS:If, the parameter is defined, the result "ODI_ADDITIONAL_JAVA_OPTIONS" ("SNP_ADDITIONAL_JAVA_OPTIONS" or "SNP_JAVA_OPTIONS") should be similar to the foregoing.

    Restart the ODI and try.

    Thank you
    G

  • Y at - there any API in EBS for updating the attributes columns on lines IN... ?

    Hi all

    I'm looking for some API which will help me to update the columns attribute on the lines of PO. I searched in metalink also but I have not found any idea for that.
    Help, please.



    Thank you
    Ravi Raj.

    API in general do not update or manipulate ATTRIBUTE columns from these customer data defined in the store. You will need to update these columns directly.

    year https://forums.Oracle.com/forums/Search.jspa?threadID=&q=attribute+and+API+and+Update&objid=C3&DateRange=Last & userID = & numResults = 15 & rankBy = 10001

    HTH
    Srini

Maybe you are looking for

  • My imac does not recognize my new western digital hard drive internal that I just installed.

    I created a bootable usb key with yosemite on this and I am trying to format the new HDD, but all options are grey and doesn't let me do anything. It is also said he has 0 KB and the hard drive is 2 TB. Ran a few commands on the terminal, I found onl

  • W520 ejection (or try) UltraBay III HDD on the wake from Hibernation

    Hello I have a w520, with a 128 SSD in the main location with the original HDD 500 into the UltraBay slot. On the wake of hibernation, the system tries to eject the disc. I tried a few solutions: 1 Windows 7 reconstruction from scratch 2. the format

  • Switch between windows missing feature

    I have Vista Ultimate and have constant blue screens - about a week.  Whenever switch between Windows function disappears until I have to restore the system to an earlier date.  Now it dioesn can't work not at all. I found a way to install the shortc

  • Problems with wireless c7280 with Windows 7 computer

    I myself am converted to a Windows Vista PC to Windows 7 64 bit and I have worth-keeping my C7280 connected wireless to the new PC.  I use a NETGEAR WNDR3700v2 router.  Any suggestions?

  • Creating new interface controller on 5508...

    After you have created a new controller interface and applying, it requires a restart of the system?  or is it just like the creation of a new interface vlan in one switch? I would have preferred not to do a reboot in the middle of the day... Thank y