Trigger to blob column in Oracle - Need Help

Hi,
I need any help on Oracle Trigger
I have two table
- BIODATA_TABLE
- ADM_GALERY_PICTURE
All two table contain column SPIC_PICTURE2 that is blob column.
If the picture column update in table BIODATA_TABLE, i want it to update also in ADM_GALERY_PICTURE,
I have created the trigger to BIODATA_TABLE.
When i try to update the picture, the picture on the ADM_GALERY_PICTURE does not updated.
Below is my trigger, Please help me to correct it
CREATE OR REPLACE TRIGGER TRANSFER_PICTURE_TRIGGER
AFTER INSERT OR UPDATE
ON BIODATA_TABLE
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
DECLARE
tmpVar NUMBER;
BEGIN
tmpVar := 0;
IF UPDATING
THEN
UPDATE ADM_GALERY_PICTURE
SET SPIC_PICTURE2 = :NEW.SPIC_PICTURE2
WHERE ADM_GALERY_PICTURE.SPIC_BIODATA_ID = :NEW.SPIC_BIODATA_ID;
END IF;
EXCEPTION
WHEN OTHERS
THEN
-- Consider logging the error and then re-raise
RAISE;
END TRANSFER_PICTURE_TRIGGER;
thanks

user450549 wrote:
Hi,
I need any help on Oracle Trigger
I have two table
- BIODATA_TABLE
- ADM_GALERY_PICTURE
All two table contain column SPIC_PICTURE2 that is blob column.
If the picture column update in table BIODATA_TABLE, i want it to update also in ADM_GALERY_PICTURE,
I have created the trigger to BIODATA_TABLE.
When i try to update the picture, the picture on the ADM_GALERY_PICTURE does not updated.
Below is my trigger, Please help me to correct it
CREATE OR REPLACE TRIGGER TRANSFER_PICTURE_TRIGGER
AFTER INSERT OR UPDATE
ON BIODATA_TABLE
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
DECLARE
tmpVar NUMBER;
BEGIN
tmpVar := 0;
IF UPDATING
THEN
UPDATE ADM_GALERY_PICTURE
SET SPIC_PICTURE2 = :NEW.SPIC_PICTURE2
WHERE ADM_GALERY_PICTURE.SPIC_BIODATA_ID = :NEW.SPIC_BIODATA_ID;
END IF;
EXCEPTION
WHEN OTHERS
THEN
-- Consider logging the error and then re-raise
RAISE;
END TRANSFER_PICTURE_TRIGGER;
thankswithout your tables & without your data we can't run or test your code.
the picture on the ADM_GALERY_PICTURE does not updated.OK, I believe you, but what EXACTLY does occur?

Similar Messages

  • ORA-03237 when creating table with BLOB columns on Oracle 9i

    I am playing with my new Oracle 9i database. I am trying to copy
    tables from my 8.1.6 db. Three tables won't create due to this
    new message. The 9i documentation says it's soemthing to do with
    freelist groups but my DBA says he hasn't set up any.
    The tablespace is one of these newfangled locally managed
    tablespaces (predetermined size 8k).
    I can create these tables if I change the BLOB column to datatype
    VARCHAR2(4000).
    I have raised this through the usual channels, but I thought I'd
    try this site as well.
    Cheers, APC

    victor_shostak wrote:
    Figured, Virtual Columns work only for Binary XML.They are only supported, currently, for Binary XML.

  • To upload a PDF file in BLOB column using Oracle Forms 9i

    Can anyone tell me how to upload a PDF file from client system using File dialog window and store its content in BLOB column in a table. The file to be uploaded will be in client side.

    Take a look at the following :
    Re: Storing a PDF in a BLOB
    Re: Retrive Image from DB into Image_item
    although the threads above are reffered to images and word doc... the procedure/steps are the same....
    Greetings...
    Sim

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

    Hi there,
    I have an Oracle table as the source and a MS SQL Server table as the target. A blob(4000) column in source is mapped with a Image(2147483647) column in target.
    The execution will give me error message "*java.lang.NumberFormatException: For input string: "4294967295"* " when it comes to step "load data into staging table"
    The LKM that I am using is LKM SQL to MSSQL.
    I also tried LKM SQL to MSSQL(BULK), LKM SQL to SQL(jython), LKM SQL to SQL. None of them is helpful.
    Coudl anyone tell me how to solve this 4294967295 problem? Thanks a lot

    Hi Yang,
    Oracle recommends the setting of the 'get_lob_precision' flag to FALSE to avoid this error.
    To do that,
    1. Take 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 set, the resulting "ODI_ADDITIONAL_JAVA_OPTIONS" ("SNP_ADDITIONAL_JAVA_OPTIONS" or "SNP_JAVA_OPTIONS") should be similar to the above.
    Restart ODI and try.
    Thanks,
    G

  • Error in Loading a BLOB Column in Oracle Database from 1 to diff  schema

    Hi ALL,
    I am in a POC where in I have to load a BLOB data from 1 schema to a different schema ie from Staging to Target.
    I load my staging(Oracle Schema ) through Oracle PLSQL. Now I have to load to my ODS.
    I am using the LKM (LKM SQL to Oracle) and IKM (IKM Oracle Incremental Update PLSQL).
    It errors out in the 3rd step 3-Loading-SS_0 Load Data
    The script used and the error message is in the attachment. However if I run the script manually it runs and the Load happens successfully. Also I was able to load the same BLOB objects it the tables were in the same schema(In this case LKM is bypassed).
    Any Thoughts on this?
    The Error I receive is:
    java.lang.NumberFormatException: For input string: "4294967295"
         at java.lang.NumberFormatException.forInputString(Unknown Source)
         at java.lang.Integer.parseInt(Unknown Source)
         at java.lang.Integer.parseInt(Unknown Source)
         at oracle.jdbc.driver.OracleResultSetMetaData.getPrecision(OracleResultSetMetaData.java:303)
         at com.sunopsis.sql.SnpsQuery.getResultSetParams(SnpsQuery.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execCollOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlC.treatTaskTrt(SnpSessTaskSqlC.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.g.y(g.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Unknown Source)
    Thanks & Regards,
    Krishna

    Hi,
    Are you at the same database? If yes is better to grant select, at the schemas where is the source, to your Staging Area user.
    Then, at topology, define all physical schemas under the same Data Server.
    If you are at distinct database a good solution is to use a DBLink (KM) because when a SQL to SQL KM is used, the data go thru agent, making a conversion to Java.
    I'm not sure if it can handle LOB's fields... Every time that I needed to use it was in the ways that I described.
    Does it make any sense to you?
    Cezar

  • How to insert and retreive zip files in to blob column in oracle database?

    This is the code to retrieve               
    while (rs.next() ) {
                        Blob fileBlobContent = rs.getBlob(1);
                        String fileName = rs.getString(2);                    
                        String value = rs.getString(3);
                        long fileNum = new Long(value).longValue();
                        java.io.InputStream is =
                             ((oracle.sql.BLOB) fileBlobContent).getBinaryStream();
                        FileOutputStream fos =
                             new FileOutputStream("c:\\temp\\"+fileName);
                        int c = -1;
                        while ((c = is.read()) != -1) {
                             fos.write(c);
    This is the code to insert into the row aftre inserting empty blob
                   // step 3 - now put the contents of the file
                   int length = 0;
                   int buff_size = 1024;
                   //Writer out_clob = ((oracle.sql.CLOB)fileCobContent).getCharacterOutputStream();
                   OutputStream outstream = ((oracle.sql.BLOB) fileBlobContent).getBinaryOutputStream();
                   long chars_read = data.length();
                   byte[] buffer = new byte[buff_size];
                   while ((length+buff_size) < chars_read) {
                        outstream.write(buffer, length, buff_size);
                        length += buff_size;
                        //outstream.flush();
                   // write remaining data
                   int remaining = (int)(chars_read-length);
                   outstream.write(buffer, length, remaining);
                   // steps 4-5:
                   outstream.flush();
    Any help is greatly appreciated. Thanks!

    String localStrFile = importFormFileArg.getFileName();
    try
    localStrFileExt = localStrFile                    .substring(localStrFile.indexOf(".") + 1);
         localInputStream = importFormFileArg.getInputStream();
         localBr = new BufferedReader(
         new InputStreamReader(                         localInputStream));
              /** Read line by line and count the tokens present */
         while ((localStrReadLine = localBr.readLine()) != null)
         localIntRecords++;
                        /* parse the file contents with the delimiter comma */
                        if ("xls".equalsIgnoreCase(localStrFileExt))
                             localIsMandatoryPresent = isMandatoryFieldsPresent(
                                  localStrReadLine, ',');*/
                             System.out.println(localStrReadLine+" first \n\n\n ");
                             localStk = new StringTokenizer(
                                  localStrReadLine, "\t");
                             StringTokenizer localStk1 = new StringTokenizer(
                                  localStrReadLine, ",");
    // here i am unable to getting the records pls any body helpme                                             }
    Edited by: mulamahi on Oct 26, 2007 12:32 AM

  • How to add two X Axis in the Column chart?Need Help

    Hi,
    I have a requirement to add two X axis in the SSRS column chart.Can someone please help how to add two X axis. I tried the secondary axis for horizontal axis but current x axis is shifting to other side, second X axis is not coming.
    Regards
    Jon

    Hi Jon,
    According to your description, you want to add secondary X axis for one series in a column chart, right?
    The secondary axis is useful when comparing two value sets with two distinct data ranges that share a common category. In Reporting Services, it’s not supported to create two X axis for one series. We can create secondary X axis when there are two series
    in a column chart. As we tested in our local environment, we can add secondary X axis for specific series. Please refer to the screenshots below:
    So I would like to know what’s your exact needs about creating two X axis for one series. If possible please share some detail information about your data and expected looking of the chart.
    Reference: Plot Data on a Secondary Axis (Report Builder and SSRS)
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu

  • New to Oracle- Need help with installation from cmd shell.

    Hello!
    I am writing a script to automate the installation of Oracle Forms and Reports 6i in XP through cmd.exe. The script works great, but the command is incomplete.
    Currently the command in the script is "setup -responseFile directory\response.rsp".
    This is supposed to generate a .rsp file containing all the options I selected in the custom installation (so I can simply call that file in future implementations of this script to automatically get all those settings), but it does not.
    Does any one know what might be wrong: why isn't this generating the response file?
    Or, do you know the arguments for the command so that I don't even need a response file?
    I've googled this about a dozen times and found nothing very helpful.
    Any advice is appreciated.
    P.S. I've also tried -record -destinationFile. No luck with that either.
    Message was edited by:
    user582111

    Madrid,
    I had already tried that with no success. Just to be sure, I tried it again a moment ago exactly as you have it written except for the location name ("setup.exe -record -destinationFile \\directory\response.rsp"). Again, I don't see a response file.
    I have viewed the link you sent me as well. Unfortunately, it looks like a I need to use the Universal Installer? I don't see anything like that in my installation directory. Am I completely missing something? Oracle is a whole new bag for me.

  • How to insert and retrieve zip files in to blob column in oracle database?

    Hi All,
    I have a requirement where i need to insert zip files to BLOB and retrieve them.
    Please suggest me any good example or redirect me to them.

    You already have a post on this subject here: read and write compressed data from blob in ADF
    Please do not post duplicate questions.

  • Need help in writing NVARCHAR2 column to an excel sheet

    Hi All,
    I have a NVARCHAR2 column in my table. I want to store the data present in the column into an excel file. When i write the data to an excel file the data is getting converted to some other form. It's not in human readable form.
    Language is not fixed for the column.
    I need help in storing the NVARCHAR2 data into an excel file without any implicit conversion done by the oracle.
    Please help.
    Thanks,
    Girish G
    Edited by: Girish G on Jul 14, 2011 2:02 AM

    Export data to BLOB (csv)

  • How to open a BLOB column stored in oracle using OLE wrappers

    Hello friends
    I have a strange problem, I have OLE objects like, *.doc, *.xls, *.bmp etc all these files have been embedded in oracle database using OLE2.0 & wrapping technology. Well I have to extract this data outof BLOB column from Oracle database & store it in OS file in its respective format
    For Eg. If the BloB data which has been embedded in Oracle database using OLE2.0 & wrapping is of *.doc file then the OS file which I have stored after extraction I should be able to open in MS word.
    Well in this task I am able to extract the file using GETCHUNK feature from VB , but I am not able to open the OS file in MS word as it is saying the error
    the document you are trying to open is not supported by MS Word
    So please any one of you can help me to solve this problem I wil be very helpful. also if you have suported code for ths problem It is welcome
    Not only using VB if you have code of any other langauges also itis welcomed
    Thanks
    Adhem

    Please "Preview" your future posts. Your formatting is awful. Especially learn to use the [ code ] tags.
    Are you sure DateTime.Now.ToString() returns a string in the format of 'MM/DD/YYYY HH:MI:SS.FF3'?
    Fix that and if you still having the problems, debug the actual result of your string.Format() and post that.

  • Need help on trigger...

    i'm the beginner in Oracle, need help on below.
    can i use statement like "Select count..." in the before and after update trigger?
    i have the "mutating" error when i create the trigger...
    pls help

    correction - there is no error generated when compile the trigger but errors when the trigger is fired:
    /* perform updating on table student*/
    update student set company_id = 60 where student_id = 9998;
    /* error return by oracle sql plus*/
    at line 1:
    4091: table SCOTT.STUDENT is mutating, trigger/function may not see it
    6512: at "SCOTT.UST_UPDPASSPORTPROGRAM", line 7
    6512: at "SCOTT.UST_UPDPASSPORTPROGRAM", line 9
    4088: error during execution of trigger 'SCOTT.UST_UPDPASSPORTPROGRAM'
    /* trigger script*/
    create or replace trigger ust_updPassportProgram
    before update
    on student
    for each row
    declare
    v_total_Student number;
    Dummy number;
    /*CURSOR Dummy_cursor (CNo NUMBER) IS*/
    /*SELECT company_id FROM company WHERE company_id = CNo;*/
    CURSOR Dummy_cursor (CNo NUMBER) IS
    SELECT student_id FROM student WHERE student_id = 9998 and company_id = CNo;
    begin
    OPEN Dummy_cursor (:new.company_id);
    FETCH Dummy_cursor INTO Dummy;
    IF Dummy_cursor%FOUND THEN
    dbms_output.put_line('Dummy found');
    end if;
    if :new.passport_program = 'Y' then
    dbms_output.put_line('The current company_id: ' ||
    to_char(:new.company_id) || :new.passport_program);
    end if;
    end;
    /

  • ORA_FFI and BLOB columns

    I'm trying to find dll library, which can write and read blob column? Can anybody help me?

    Shay, thanks for your reply.
    Is my interpretation of your advice correct?
    1. I need to use Java to replace the Delphi dll to allow me to copy/paste the client clipboard to/from a file.
    2. If the file is on the client then I will also need to use Java in place of text_io to read from the file.
    3. Could I use Java to copy to/paste from the client clipboard to a server file. That way I would not need to change the text_io code?
    Thanks
    Stewart

  • Need to create link to Word Doc in blob column in search results report

    I got the Oracle Text boolean search of word documents in a blob column of a table working.
    Now I need to be able to create a link in the results report.
    I know that Oracle creates a link for each document in the column when you attach a file, I just need to know what the link should be to allow users to open the document in the search results report.
    Right now the application is set to do a search in the attached word documents, and in the results window it shows the names of the people who match the search, but it won't allow me to create a link to their resume in the results report.
    the name of the table is CONTRACTOR_LIST and the blob column is RESUME.
    How would you go about creating a simple link to the word file in the results window?
    Here is the code for the query
    select score(1) relevance, Name, Resume
    from contractor_list
    where CONTAINS (resume, :P1_SEARCH, 1) > 0
    order by 1 desc
    That works, but I can't get it to link to the resume file.
    Here is the code I'm using for the link
    javascript:popupURL(&quot;#RESUMEL#&quot;)
    This just give me an error page and the the link is
    http://server-namer:8080/apex/[datatype]
    the error is
    Bad Request
    The HTTP client sent a request that this server could not understand.
    Thanks again!
    Edited by: gjones77 on Dec 2, 2008 6:14 AM
    Edited by: gjones77 on Dec 2, 2008 7:08 AM

    It is within the table I believe (I'm not a DBA or a developer) since I created a BLOB column and then used the file browse feature to allow users to attach a resume to the table in order to be able to perform a search of the attached documents.
    I'm just having a hard time pointing the link in the search results report to the document in the blob column.
    The information on that page is great if you're trying to create a link to the document on the initial report.
    But I created a query using Oracle Text to run a report that does a boolean search of the attached word documents in the table.
    When it displays the search results, it doesn't create a link to the document and I can't figure out how to do it.
    Here's a link the the instructions I used to create the initial search report with Oracle Text, mind you I only created the index and query, I didn't add in all the link data since they're using documents on websites and I'm using documents in a table.
    http://www.oracle.com/technology/products/database/application_express/pdf/apex_text_application_v1.6.pdf
    If you can help me with this I'd really appreciate it.
    Thanks again.
    Greg
    Edited by: gjones77 on Dec 2, 2008 8:14 AM

  • Uploading a file (.doc, .xls, .txt) into an Oracle table with BLOB column

    Hello All :
    I have been trying to figure out for a simple code I can use in my JSP to upload a file (of any format) into an Oracle table with a BLOB column type. I have gone through a lot of existing forums but couldnot find a simple code (that doesnot use Servlet, for eg.) to implement this piece.
    Thanks a lot for your help !!

    Hi.
    First of all to put a file into Oracle you need to get the array of bytes byte[] for that file. For this use for example FileInputStream.
    After you get the byte array try to use this code:
            try {
                Connection conn = myGetDBConnection();
                PreparedStatement pstmt = conn.prepareStatement("INSERT INTO table1 (content) VALUES(?)");
                byte[] content = myGetFileAsBytes();
                if (content != null) {
                    pstmt.setBinaryStream(0, new ByteArrayInputStream(content), content.length);
                pstmt.close();
                conn.close();
            } catch (Exception ex) {
                ex.printStackTrace();
            }or instead of using ByteArrayInputStream try pstmt.setBinaryStream(0, new FileInputStream(yourFile), getFileSize());Hope this will help...
    regards, Victor Letunovsky

Maybe you are looking for

  • How can I print all my contacts including phone numbers from iCloud

    I used to be able to print all of my contacts including phone numbers etc from iCloud.  Since all the upgrades I can not do this.  I used to be able to change the display by clicking on a ribbon at the top then clicking the gear to have it print.  No

  • Implementing Digital Signature Strategy In Adobe Forms

    Hi Everyone, I need to know how to implement Digital Signatures with the use of Signature Strategy in my ECC 6.0 system.. Here is what i've done already, 1) Created a signature strategy with user authentication and registered the Signature Object in

  • Resource consumption details not shown for each row source operation

    Hi Friends, I have generated a tracefile for a query as shown below. set autotrace traceonly arraysize 100 ALTER SESSION SET optimizer_mode = ALL_ROWS ; alter session set tracefile_identifier = 'trcwithtime_221010_03'; alter session set events '10046

  • Reg :File upload and download from client machine

    hi.. anyone help me the way that how to upload and download word document file from client machine.. i am using j2eeserver1.4 in linux.. i want upload file from client machine(windows) to server(linux.) please help me . tell me idea regarding.. i hav

  • Error Code (-20)

    Does anybody know what this is, and how to fix it? It is interrupting my syncs, and not putting the tracks that I am asking for on the phone. The exact text for this error code is: itunes could not back up the iphone "Tims iphone" because an unknown