Trigger problem -- can't insert the same data into audit table

Sir/Madam,
I'm trying to use insert trigger with a 'long raw' datatype data for my audit purpose. Each time, the data of original table can be inserted correctly. While the trigger for audit table in which it contains almost the same data as original would failed. The error messages are some thing like following:
java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column
ORA-06512: at "CORPSEC.TI_ARCHIVE_PDF", line 9
ORA-04088: error during execution of trigger 'CORPSEC.TI_ARCHIVE_PDF'
If the column with 'long raw' datatype is taken out, then there is no error at all. I'm using Oracle 8i 8.1.6 for Windows NT and suspect there is bug in PL/SQL execution.
The following are SQL text for the trigger:
CREATE OR REPLACE TRIGGER "CORPSEC"."TI_ARCHIVE_PDF" AFTER INSERT ON "ARCHIVE_PDF" FOR EACH ROW DECLARE
LOG_SEQ_NO NUMBER;
BEGIN
SELECT AUDIT_SEQ.NEXTVAL INTO LOG_SEQ_NO FROM DUAL
insert into ad_archive_pdf (DOC_TITLE,PDF_FILENAME,CONTENT,DOC_DESC,AUDIT_REF_NO,AUDIT_DATE,AUDIT_MODE,AUDIT_BY)
values (:new.DOC_TITLE,:new.PDF_FILENAME,:new.CONTENT,:new.DOC_DESC,LOG_SEQ_NO,sysdate,'I',:new.created_by);
END;
Any help on this. Thank in advance.
Best regards,
Ruijie

See here for a discussion of how to incorporate LONG datatypes into triggers:
http://asktom.oracle.com/pls/ask/f?p=4950:8:635439::NO::F4950_P8_DISPLAYID

Similar Messages

  • Need help in SQL Query: Update a row in a table & insert the same row into another table

    I want to update a row in a table say Table A and the updated row should be inserted into another table say Table B. I need to do it in a single SQL query and i don't want to do it in PL/SQL with triggers. And i tried with MERGE statement but its working with this scenario. (Note: I'm using Oracle Database 10g Enterprise Edition Release 10.2.0.1.0).
    Thanks in Advance.

    Using Sven's code as an example, you could save the updated row in a sql plus variable. (also untested):
    SQL> var v_id number
    update tableA  
    set colB='ABC' 
    where colC='XYZ' 
    returning id into :v_id;
    insert into table A_History (ID, colA, colB, ColC)  
    select id, ColA, ColB, ColC  
    from tableA  
    where id = :v_id;   

  • Can we bind the same fragments into different xsd Schemas

    I have created different fragments for a single form. I have to render the fragments as well as the complete form on the web. I have created the different services for each fragment and bind the schema with them and this works fine for me but while using the same all fragments in one complete form I am not able to get the data. How can I do this?
    Can we bind the same fragments into different Schemas? If yes, then how?
    Or we need to follow some other approach?

    yes, we are using the LiveCycle Designer and LiveCycle Workbench Process for rendering the PDF form.

  • How could I insert the deleted row into another table within a trigger?

    Hi,
    How could I insert the deleted row into another table within a trigger? The destination table has the same columns as the source table. Since the statements are in the trigger, it is not allowed to query the source table named 'test'. Thanks! The trigger is as follows, uncompleted:
    CREATE TRIGGER delete_trigger
    AFTER DELETE
    ON test
    FOR EACH ROW
    BEGIN
    -- How could I insert the deleted row into another table
    END delete_trigger;
    Message was edited by:
    user569548

    Hi,
    I'm not sure what's wrong there.
    I read the oracle docs about ANALYZE and ALL_TAB_COLUMNS, and did the following:
    ANALYZE TABLE my_tab VALIDATE STRUCTURE; //went ok.
    SELECT column_name
    FROM all_tab_columns
    WHERE table_name = 'my_tab'; //but no rows selected?
    This topic might not be what this thread should be about. Here I posted a new thread:
    How to get colum names of the newly created table?
    Thanks.
    Message was edited by:
    user569548

  • Can I insert the image file into PDF file  in Adobe X Standard ?

    can I insert the image file into PDF file in Adobe X Standard ?

    http://matt.coneybeare.me/how-to-make-an-html-signature-in-apple-mail-for-maveri cks-os-x-10-dot-9/

  • How can I read the trace data into LabVIEW for E5071B

    HI 
    I am setting up the measurement using vector network analyzer (VNA) E5071B controlled by NI 488.2. How can I read the trace data into LabVIEW and display on the graph? If anyone having an idea or know well about this process please give me the suggestion, I will much appreciate it.
    Many Thanks

    You want to start with the driver
     In case you do not know it, you can do the driver search in LabVIEW from Tools>Instrumentation>Find Instrument Drivers. You might also want to bookmark the Instrument Driver Network for information on what a driver is and how to use it.

  • How can I use the same data source twice?

    in our system there is already a complete transfer of calculations to BI (0CO_PC_PCP_01).
    However I want to create a new data flow from ERP starting from the same data source.
    Is this possible?
    Thanks for help!!

    Hi!
    welcome to SDN forums.
    anydata source can be mapped only to a single infosource. but it will not ristrict you to have different datatargets from a single infosource. so you have to use filters in infopackages to select the data target and filter the data for this data sources. Only thing you have to do with old  dataflow is just ristrict the data relavent for  the 1st Datatarget in old Infopackage and re.initialize.
    with regards
    ashwin

  • Why I can't insert the eject tool into my ipad 4's sim tray

    Hey every one.
    I have an iPad 4 wi-fi cellular
    I want to ejec it's SIM tray but I can't push the eject tool into that tiny hole.It seems like there is no space for it.It just goes straight down and I can't insert it in a 45 degrees angle.
    Someone plz heeelllpppp!
    (Sorry English is not my native language :) )

    Give it a little push. If the tray still doesn't open I'd stop by the Apple Store and let them have a look.

  • How can i extract the particular data from Base tables

    Hi
    I have some Base R/3- Tables . I need to exact the data from these base tables.
    But i need to select some type of datarecords(eg: select Material Documents from MSEG and MKPF tables based on movement types 261,262).
    Something like that . So how can i select the particular category datarecords from base tables. Anyway im going to create the Custom DataSource.
    So please let me know . how can i extarct tha particular data from base tables
    kumar

    Hi Venkat
    See i have some 5-tables . I need to extarct from these tables.
    first i need to extract the data from one table fully.
    Then i need to extarct the data from second table based on profict centers, company codes of first table.
    Then i need to extract the data from third table based on profict centers of first table and movement type = 2p,2n,2s condition.
    So how can i extarct like this data from multiple tables.
    Please let me know
    kumar

  • Extract the classification data into internal table

    Hi all,
    I having requirement to extract classification data for material number.
    1) Provide the selection option for material number (MATNR).
    2) Based on the material number, then extract all that data into internal table as below layout. My problem is how to retrieve the following data from different table based on the MATNR (material number).
    Please provide the sample code for select the following data. Thanks.
    Classification table
    OBJEK  (from AUSP table)
    MAFID (from AUSP table)
    KLART (from AUSP table)
    CLASS  (from KLAH table)
    ATWRT (from AUSP table)
    MSEHI  (from CABN table)
    OBTAB (check if class type=002, set it as “MARA”)
    STDCL (from KSSK table)

    Hi,
    if I understand, you´re trying to get information from the classification system for the material. You can use the following code:
    DATA: clases LIKE TABLE OF sclass WITH HEADER LINE,
          datos LIKE TABLE OF clobjdat WITH HEADER LINE.
    CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'
         EXPORTING
              class              = 'DESK'               "clase a buscar
              classtype          = '001'                "tipo de la clase
              features           = 'X'
              language           = sy-langu
              object             = 'PM00A000C055'       "Material
              objecttable        = 'MARA'
              key_date           = sy-datum
              initial_charact    = 'X'
              change_service_clf = 'X'
         TABLES
              t_class            = clases
              t_objectdata       = datos
         EXCEPTIONS
              no_classification  = 1
              no_classtypes      = 2
              invalid_class_type = 3
              OTHERS             = 4.
    loop at datos.
    endloop.

  • Audit- Not laoding Audit data into Audit tables

    Hi ,
    Audit data not loading into audit tables in my XI3.1 SP4Environament.
    Audit data base is in SQL SERVER 2008 R2
    where Audit  database congigured , audit events enabled properly.
    and also log files creating without any errors also
    Please help me ..
    Edited by: Reddeppa Konduru on Nov 9, 2011 11:31 AM
    Edited by: Reddeppa Konduru on Nov 9, 2011 12:31 PM

    I am getting below error
    bsystem_impl.cpp:2651: TraceLog message 1
    2011/11/09 03:22:47.071|>>|A| |13664|9368| |||||||||||||||assert failure: (.\auditsubsystem_impl.cpp:2651). (false : Next event id value should be greater than the current one, check the auditee packing events code).

  • PPOME - Can't insert the SAME task for different organization unit

    Hi all,
    I have a doubt; in SAP 46C, it seems that is impossible to insert in PPOME, Detailed window, Tasks tab the same task for different organization unit. The only way to do this is in PP01 - General management, where you can explicitely create a [B-007] relations with the same "T" Object. Now, it is a little bit difficult for a user to switch from PPOME ad PP01 when defining new organizational structure.
    The question: is there any way to insert the <b>SAME</b> task directly in PPOME, overwriting the standard behaviour of the system that by default create a new task for each new insertion?
    Thanks all
    Paolo

    Hi Naveen
    thank you for your prompt reply.
    The issue that I want to solve is that some organization unit (not all) must be flagged for an external export to another system, depending on some characteristic of each org unit. I didn't find a similar attribute on standard field, so I thought to insert a common task to all the org units to export, so that this relation can serve as the missing attribute on org unit definition.
    PP01 let me insert a task (type T, and not TS) on an org unit directly, so I want to know if I'm going to break some standard behaviour of SAP if I insert a task on OU.
    Thank you
    Paolo

  • My vi is writing just the same data into spreadsheet even after changing the loop iteration time. hw can I change this mode ?

    My VI is writing the same amount of data into spreadsheet file even after changing the for-loop iteration time

    You should post the VI (with appropriate values saved as default) to this thread.  (At least a JPEG or PNG screenshot).
    Inside the For Loop, right-click on the N terminal and create Indicator.  Run the VI and you will see how many times the Loop spins.
    Further guessing:  You may have a 2D array with two rows and many columns feeding the For Loop.

  • Importing multiple rows from the same date from one table to another.

    I need to pull information from one sheet(Sheet 1) to another (Sheet 3). I am able to pull the first line of info with VLookup but need all rows for a specific date, which could range from zero to 10 rows depending on the day according to the date in cell G1 on Sheet 3. I am importing the needed information from Sheet 2 with vlookup, but since it is information from one cell to another its not an issue. Is there a way to transfer the needed data?

    Hello
    Here's another method to build a summary table, which calculates index of every row in source data matching given key and use the indices to retrieve rows of data.
    E.g.,
    Data (excerpt)
    A1  date
    A2  2015-03-12
    A3  2015-03-12
    A4  2015-03-12
    A5  2015-03-12
    B1  a
    B2  A
    B3  B
    B4  C
    B5  D
    C1  b
    C2  1
    C3  2
    C4  3
    C5  4
    Summary (excerpt)
    A1  a
    A2  =IF($D2<>"",INDEX(Data::B,$D2,1),"")
    A3  =IF($D3<>"",INDEX(Data::B,$D3,1),"")
    A4  =IF($D4<>"",INDEX(Data::B,$D4,1),"")
    A5  =IF($D5<>"",INDEX(Data::B,$D5,1),"")
    B1  b
    B2  =IF($D2<>"",INDEX(Data::C,$D2,1),"")
    B3  =IF($D3<>"",INDEX(Data::C,$D3,1),"")
    B4  =IF($D4<>"",INDEX(Data::C,$D4,1),"")
    B5  =IF($D5<>"",INDEX(Data::C,$D5,1),"")
    C1  2015-03-11
    C2 
    C3 
    C4 
    C5 
    D1  index
    D2  =IFERROR(MATCH(C$1,Data::A,0),"")
    D3  =IFERROR(MATCH(C$1,OFFSET(Data::A,D2,0,ROWS(Data::A)-D2,1),0)+D2,"")
    D4  =IFERROR(MATCH(C$1,OFFSET(Data::A,D3,0,ROWS(Data::A)-D3,1),0)+D3,"")
    D5  =IFERROR(MATCH(C$1,OFFSET(Data::A,D4,0,ROWS(Data::A)-D4,1),0)+D4,"")
    Notes.
    Formula in A2 and B2 can be filled down.
    Formula in D3 can be filled down. Note that D2 has different formula than D3.
    Tables are built in Numbers v2.
    Hope this may help you to get the basic idea.
    H

  • How can we upload the Time data into SAP system

    Dear all,
    ingeneral which method we can use to read the Time data and how can we upload that data into SAP system. Please any one can answer this asap.

    In the recent project that I have done.. the time data is uploaded from the external time recording machine.. in the form a file...
    The other way is through CATS... which in turn will populate the time entries as per hte work schedules... and will explicitly have to populate the deviations to the work scheudle by going through transactions..
    Please reward the points if it is helpful...
    Regards,
    Suvan,
    Yash Technologies Pvt Ltd, Hyderabad.
    Message was edited by:
            Suvan

Maybe you are looking for