Trigger cons

I have two databases A and B.
We are replicationg data using shareplex from database A to database B.
Millions of rows are coming from A to B.
Our developer wants to create triggers on tables on database B and populate the data for some reporting purpose.
Will it affect the performance?
Thanks,
Arun

I had written a response but got tied up while typing so I looked before posting. I see Justin answered so I will just second his opinion.
It really depends on how Shareplex works. In any event if you add a row trigger to a table if the inserting operation used array inserts you just converted it to a row by row operation so the chance of this being noticable is high except for very small data loads.
How much logic exists in the triggers also comes into play.
You might want to set up a couple of tables with triggers and just test.
HTH -- Mark D Powell --

Similar Messages

  • Import finished with few errors...Help understanding it!

    Hi all,
    Yesterday, I finished to do an import in oracle. I used the impdp command and got few errors after the import was done. Here are some bits from my log. It was very long but I shortened it with the most common errors. I would appreciate your help understanding what does each error mean, and whether there's a solution available.
    Thanks!
    El sql que falla es:
    CREATE TABLESPACE "SYSAUX" DATAFILE SIZE 125829120 LOGGING ONLINE PERMANENT BLOCKSIZE 16384 EXTENT MANAGEMENT LOCAL AUTOALLOCATE DEFAULT NOCOMPRESS SEGMENT SPACE MANAGEMENT AUTO
    ORA-39083: Fallo de creación del tipo de objeto TABLESPACE con el error:
    ORA-02236: nombre de archivo no válido
    El sql que falla es:
    CREATE TABLESPACE "IN_SGC_BD" DATAFILE '+DISKGROUP_BD/sgtc/datafile/rsgtc_in_sgt_bd1' SIZE 132120576 LOGGING ONLINE PERMANENT BLOCKSIZE 16384 EXTENT MANAGEMENT LOCAL AUTOALLOCATE DEFAULT NOCOMPRESS SEGMENT SPACE MANAGEMENT MANUAL
    Procesando el tipo de objeto DATABASE_EXPORT/PASSWORD_VERIFY_FUNCTION
    ORA-31684: El tipo de objeto PASSWORD_VERIFY_FUNCTION ya existe
    Procesando el tipo de objeto DATABASE_EXPORT/SCHEMA/SEQUENCE/GRANT/OWNER_GRANT/OBJECT_GRANT
    ORA-39111: Se ha saltado el tipo de objeto dependiente OBJECT_GRANT:"SYSTEM", ya existe el tipo de objeto base SEQUENCE:"SYSTEM"."SDE_LOGFILE_LID_GEN"
    ORA-39083: Fallo de creación del tipo de objeto SYNONYM con el error:
    ORA-00995: falta el identificador de sinónimos o no es válido
    BEGIN
    dbms_resource_manager.create_consumer_group('AUTO_TASK_CONSUMER_GROUP','System maintenance task consumer group','ROUND-ROBIN');COMMIT; END;
    Procesando el tipo de objeto DATABASE_EXPORT/SYSTEM_PROCOBJACT/POST_SYSTEM_ACTIONS/PROCACT_SYSTEM
    ORA-39083: Fallo de creación del tipo de objeto PROCACT_SYSTEM con el error:
    ORA-29393: el usuario JAIMESP no existe o no está conectado
    El sql que falla es:
    BEGIN
    dbms_resource_manager.create_plan_directive('PLAN_DIA','SGTC_USR','',30,NULL,NULL,NULL,NULL,NULL,NULL,NULL,30,600,5,'SGTC_SWITCH',NULL,TRUE,NULL,10240,1800,900,1800);
    dbms_resource_manager.create_plan_directive('PLAN_DIA','SGTC_EDITOR','',40,NULL,NULL,NULL,NULL,NULL,NULL,NULL,10,600,10,'SGTC_SWITCH',NULL,TRUE,NULL,512000,1800,600,3600);
    dbms_r
    ORA-39083: Fallo de creación del tipo de objeto PROCACT_SYSTEM con el error:
    ORA-06550: línea 2, columna 72:
    PLS-00103: Se ha encontrado el símbolo "CHECK" cuando se esperaba uno de los siguientes:
    in like like2 like4 likec between member submultiset
    Procesando el tipo de objeto DATABASE_EXPORT/SCHEMA/TABLE/TABLE
    ORA-39151: La tabla "OUTLN"."OL$" existe. Todos los metadados dependientes y los datos se saltarán debido table_exists_action de saltar
    Procesando el tipo de objeto DATABASE_EXPORT/SCHEMA/TABLE/TABLE_DATA
    . . "SIGELEC"."SDE_BLK_37" 4.976 KB 0 filas importadas
    . . "SIGELEC"."SDE_BLK_38" 4.968 KB 0 filas importadas
    . . "SGC_BD"."BDE_CRECOBJE" 5.234 KB 0 filas importadas
    . . "SIGELEC"."D418" 4.851 KB 0 filas importadas
    . . "SYSTEM"."DBM_TOPSQL" 6.125 KB 0 filas importadas
    . . "SIGELEC"."F100" 5.562 KB 0 filas importadas
    . . "SIGELEC"."F101" 5.593 KB 0 filas importadas
    . . "SIGELEC"."F102" 14.77 KB 11 filas importadas
    Procesando el tipo de objeto DATABASE_EXPORT/SCHEMA/PROCEDURE/ALTER_PROCEDURE
    ORA-39082: El tipo de objeto ALTER_PROCEDURE:"SYSTEM"."GEN_ROLE_SGTC" se ha creado con advertencias de compilación
    ORA-39083: Fallo de creación del tipo de objeto PACKAGE_BODY con el error:
    ORA-04052: se ha producido un error al consultar el objeto remoto ENLACE.ELPQ_DATOPROY@CRE
    ORA-00604: se ha producido un error a nivel 4 de SQL recursivo
    ORA-12154: TNS:no se ha podido resolver el identificador de conexión especificado
    ORA-39082: El tipo de objeto TRIGGER:"SIGERED"."TR_CTRL_ENERGIZA" se ha creado con advertencias de compilación
    ORA-39083: Fallo de creación del tipo de objeto TRIGGER con el error:
    ORA-04052: se ha producido un error al consultar el objeto remoto ENLACE.ELPQ_DATOCONS@CRE
    ORA-00604: se ha producido un error a nivel 4 de SQL recursivo
    ORA-12154: TNS:no se ha podido resolver el identificador de conexión especificado
    El sql que falla es:
    ALTER TRIGGER "SIGERED"."TR_CTRL_ENERGIZA" COMPILE PLSQL_OPTIMIZE_LEVEL= 2 PLSQL_CODE_TYPE= INTERPRETED PLSCOPE_SETTINGS= 'IDENTIFIERS:NONE'
    ORA-39082: El tipo de objeto TRIGGER:"SIGERED"."TR_CTRL_CONCLUYE" se ha creado con advertencias de compilación
    El sql que falla es:
    BEGIN SYS.DBMS_IJOB.SUBMIT( JOB=> 165, LUSER=> 'SYSTEM', PUSER=> 'SYSTEM', CUSER=> 'SYSTEM', NEXT_DATE=> TO_DATE('2012-05-02 01:00:00', 'YYYY-MM-DD:HH24:MI:SS'), INTERVAL=> 'TRUNC(SYSDATE+1)+1/24', BROKEN=> FALSE, WHAT=> 'dbms_stats.gather_schema_stats(ownname => ''SIGERED'',options => ''GATHER'',estimate_percent => null,method_opt => ''FOR ALL COLUMNS SIZE 1'',cas
    ORA-39083: Fallo de creación del tipo de objeto JOB con el error:
    ORA-00001: restricción única (SYS.I_JOB_JOB) violada
    El sql que falla es:
    BEGIN SYS.DBMS_IJOB.SUBMIT( JOB=> 47, LUSER=> 'SIGERED', PUSER=> 'SIGERED', CUSER=> 'SIGERED', NEXT_DATE=> TO_DATE('2012-05-02 01:00:00', 'YYYY-MM-DD:HH24:MI:SS'), INTERVAL=> 'TRUNC(SYSDATE+1)+01/24', BROKEN=> FALSE, WHAT=> 'SIGERED.RDPQ_PROYECTOS.PR_PROCESAR;', NLSENV=> 'NLS_LANGUAGE=''AMERICAN'' NLS_TERRITORY=''AMERICA'' NLS_CURRENCY=''$'' NLS_ISO_CURRENCY=''AMERI
    Procesando el tipo de objeto DATABASE_EXPORT/SCHEMA/POST_SCHEMA/PROCACT_SCHEMA
    Procesando el tipo de objeto DATABASE_EXPORT/SCHEMA/PASSWORD_HISTORY
    ORA-39083: Fallo de creación del tipo de objeto PASSWORD_HISTORY con el error:
    ORA-01858: se ha encontrado un carácter no numérico donde se esperaba uno numérico
    El trabajo "SYS"."SYS_IMPORT_FULL_01" ha terminado con 2249 error(es) en 17:21:02

    Hello people,
    I just run for the second time a full import, and it said it finished correctly.
    The first time I run it, there was a message which said that the import had finished with 2249 errors (I checked my log and not all of them were errors but messages). I checked each single message and only had to solve a couple of things.
    I first created a user in response to an ora-29393: user string does not exist or is not logged on.
    The second thing I did was to run the utlrp.sql file in response to an ORA-39082. I did this according to this blog.
    I know oracle is taking precedence each time I run an import. I don’t know if what I have done is okay or perhaps not all data was imported after all. This is the thread which I posted initially when errors came out.
    Any reply is a supply.
    Thanks loads

  • SALVE A TUTTI, SONO UNA NEW ENTRY

    Ciao a tutti. Sono nuovo dell'ambiente e pure neo autodidatta con Labview, per cui volevo chiedervi qualche idea o consiglio su ciò che devo sviluppare e le difficoltà che sto incontrando. In particolare sto lavorando con una PCI6601 e il mio scopo è quello di contare il numero di impulsi rilevati da un fotomoltiplicatore.
    La questione è la seguente: é possibile fare ciò all'interno di un ristretto gate (sull'ordine dei microsecondi peraltro possibilmente variabile dal frontpanel)?? E se sì, il conteggio va fatto dando una funzione che conti il passare del tempo (ma io ne vedo solo alcune che stanno sull'ordine dei millisecondi) oppure mi conviene generare un segnale con determinate caratteristiche da utilizzare come gate (tipo: smetti di contare quando lo stato del segnale è low). Considerate che il tutto va ripetuto ciclicamente per n volte distanziate tra di loro da pochi millisec... (cosa che cmq si fa con un bel ciclo for)
     Eventualmente , da  un punto di vista delle connessioni (proprio come si attaccano i fili !!!) devo collegare il  "segnale gate" dalla connessione del canale di generazione del segnale (out(1) ad esempio) alla connessione gate(2) del canale di acquisizione e conteggio (source(2) per esempio) ???
    Come vedete forse ho esagerato, ma è un bel pò che ci sto sbattendo la testa...quindi se qualcuno può aiutarmi , casomai anche con qualche esempio in allegato, ve ne sarei veramente grato.
    Ciao

    Ciao,
    quello che puoi pensare di fare e'
    - creare un Counter Input Channel in modalita' Count Edges
    - configurare un Trigger di tipo Pause Trigger con un Trigger property node. Selezionare come Source di questo Trigger il Gate del contatore e selezionare come modalita' Pause Trig When Low.
    In questo modo il task sul contatore conta soltanto quando sul Gate si trova un segnale alto.
    Allegati:
    pause trig.JPG ‏47 KB

  • Error while creating a simple trigger in Oracle8i Lite

    Hi,
    I have Oracle8i Lite release 4.0.
    I want to create a simple trigger on 8i Lite.
    first I created .java file and got the .class file after successful compilation.
    The .class file is sitting in my local C:\ drive.
    I have a table having only two columns in 8i Lite and the structure is
    TABLE : SP
    ACC_NO NUMBER,
    ACC_DESC VARCHAR2(20)
    Then I issued the command :
    SQL> ALTER TABLE SP ATTACH JAVA SOURCE "JournalInst" in '.';
    After that getting the following error :
    alter table sp attach java source "JournalInst" in '.'
    ERROR at line 1:
    OCA-30021: error preparing/executing SQL statement
    [POL-8028] error in calling a java method
    Following is the cause/action for the error code :
    POL-8028 Error in calling a Java method
    Cause: Most commonly refers to a problem when converting between Java and Oracle Lite datatypes.
    Action: Check the calling parameters.
    I can't understand where I am wrong ?
    Could anybody help me out ?
    Here is my source code of .java file
    import java.lang.*;
    import java.sql.*;
    class JournalInst {
    public void INSERT_JOURNAL(Connection conn, double AccNo, String AccDesc)
    System.out.println("Record Inserted for :"+AccNo +" "+AccDesc);
    Thanks in advance for solutions.
    Sarada
    null

    I just started with 8i Lite, but as far as I know 8i Lite does not support PL/SQL code.
    So you have to write your triggers and stored procedures in Java.
    Ciao

  • Unable to trigger my event

    dear experts,
                            I need to add some extra features to title bar of my alv report.i got some documents and iam trying on that.Here in my program its displaying the newly created icon but when i click on that icon its not displaying or teriigering my event -
    class lcl_event_receiver definition deferred.
    TYPE-POOLS: ICON.
    data: con type ref to cl_gui_custom_container,
          gr_alvgrid type ref to cl_gui_alv_grid.
    DATA: ITAB_EXCLUDE TYPE UI_FUNCTIONS.
    DATA: WA_EXCLUDE TYPE UI_FUNC.
    data: it_toolbar  TYPE stb_button.
    data: begin of itab occurs 0.
            include structure mara.
    data: end of itab.
    data: event_receiver TYPE REF TO LCL_EVENT_RECEIVER.
    select * from mara into table itab.
    call screen 1000.
          CLASS lcl_event_receiver DEFINITION
    CLASS lcl_event_receiver DEFINITION.
      PUBLIC SECTION.
        class-methods: handle_toolbar for event toolbar of cl_gui_alv_grid importing e_object e_interactive,
        handle_menu_buttons for event menu_button of cl_gui_alv_grid importing e_object e_ucomm,
        handle_USER_COMMAND for event user_command   of cl_gui_alv_grid importing e_ucomm.
    ENDCLASS.                    "lcl_event_receiver DEFINITION
          CLASS lcl_event_receiver IMPLEMENTATION
    CLASS lcl_event_receiver implementation.
      method handle_toolbar.
        move 'DETAIL-TAIL' TO IT_TOOLBAR-FUNCTION.
        MOVE ICON_DETAIL TO IT_TOOLBAR-ICON.
        MOVE 2 TO IT_TOOLBAR-BUTN_TYPE.
        APPEND IT_TOOLBAR TO E_OBJECT->MT_TOOLBAR.
      ENDMETHOD.                    "handle_toolbar
      METHOD HANDLE_MENU_BUTTONS.
        IF E_UCOMM = 'DETAIL'.
          CALL METHOD e_object->add_function
            EXPORTING
              fcode = 'DISPLAY'
              text  = 'DISPLAY'.
        ENDIF.
      ENDMETHOD.                    "HANDLE_MENU_BUTTONS
      METHOD handle_user_command.
        CASE e_ucomm.
          WHEN 'DISPLAY'.
            MESSAGE 'Menu Clicked' TYPE 'I'.
        ENDCASE.
      ENDMETHOD.                           "handle_user_command
    ENDCLASS.                    "lcl_event_receiver IMPLEMENTATION
    MODULE STATUS_1000 OUTPUT
    MODULE STATUS_1000 OUTPUT.
    SET PF-STATUS 'xxxxxxxx'.
    SET TITLEBAR 'xxx'.
      CREATE OBJECT CON
        EXPORTING
       PARENT                      =
          CONTAINER_NAME              = 'CO_CON'
       STYLE                       =
       LIFETIME                    = lifetime_default
       REPID                       =
       DYNNR                       =
       NO_AUTODEF_PROGID_DYNNR     =
    EXCEPTIONS
       CNTL_ERROR                  = 1
       CNTL_SYSTEM_ERROR           = 2
       CREATE_ERROR                = 3
       LIFETIME_ERROR              = 4
       LIFETIME_DYNPRO_DYNPRO_LINK = 5
       others                      = 6
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CREATE OBJECT GR_ALVGRID
        EXPORTING
        I_SHELLSTYLE      = 0
        I_LIFETIME        =
          I_PARENT           =  CON
        I_APPL_EVENTS     = space
        I_PARENTDBG       =
        I_APPLOGPARENT    =
        I_GRAPHICSPARENT  =
        I_NAME            =
        I_FCAT_COMPLETE   = SPACE
      EXCEPTIONS
        ERROR_CNTL_CREATE = 1
        ERROR_CNTL_INIT   = 2
        ERROR_CNTL_LINK   = 3
        ERROR_DP_CREATE   = 4
        others            = 5
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      WA_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_MAXIMUM.
      APPEND WA_EXCLUDE TO ITAB_EXCLUDE.
      WA_EXCLUDE = CL_GUI_ALV_GRID=>MC_mb_SUM.
      APPEND WA_EXCLUDE TO ITAB_EXCLUDE.
      CALL METHOD GR_ALVGRID->SET_TABLE_FOR_FIRST_DISPLAY
        EXPORTING
       I_BUFFER_ACTIVE               =
       I_BYPASSING_BUFFER            =
       I_CONSISTENCY_CHECK           =
          I_STRUCTURE_NAME              = 'MARA'
       IS_VARIANT                    =
       I_SAVE                        =
       I_DEFAULT                     = 'X'
       IS_LAYOUT                     =
       IS_PRINT                      =
       IT_SPECIAL_GROUPS             =
          IT_TOOLBAR_EXCLUDING          = ITAB_EXCLUDE
       IT_HYPERLINK                  =
       IT_ALV_GRAPHICS               =
       IT_EXCEPT_QINFO               =
       IR_SALV_ADAPTER               =
        CHANGING
          IT_OUTTAB                     = ITAB[]
       IT_FIELDCATALOG               =
       IT_SORT                       =
       IT_FILTER                     =
    EXCEPTIONS
       INVALID_PARAMETER_COMBINATION = 1
       PROGRAM_ERROR                 = 2
       TOO_MANY_LINES                = 3
       others                        = 4
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CREATE OBJECT event_receiver.
      SET HANDLER event_receiver->handle_user_command
                  event_receiver->handle_menu_buttons
                  event_receiver->handle_toolbar FOR ALL INSTANCES.  "*Calling the interactive toolbar method of ALV
      CALL METHOD GR_ALVGRID->set_toolbar_interactive.
    ENDMODULE.                 " STATUS_1000  OUTPUT
    *&      Module  USER_COMMAND_1000  INPUT
          text
    MODULE USER_COMMAND_1000 INPUT.
    ENDMODULE.                 " USER_COMMAND_1000  INPUT

    hi marcin, thanks a lot for your help..i have coded but still unable to trigger user_commaned method.Could you check this in your machine-
    class lcl_event_receiver definition deferred.
    TYPE-POOLS: ICON.
    data: con type ref to cl_gui_custom_container,
          gr_alvgrid type ref to cl_gui_alv_grid.
    DATA: ITAB_EXCLUDE TYPE UI_FUNCTIONS.
    DATA: WA_EXCLUDE TYPE UI_FUNC.
    data: it_toolbar  TYPE stb_button.
    data: begin of itab occurs 0.
            include structure mara.
    data: end of itab.
    data: event_receiver TYPE REF TO LCL_EVENT_RECEIVER.
    select * from mara into table itab.
    call screen 1000.
          CLASS lcl_event_receiver DEFINITIONL
    CLASS lcl_event_receiver DEFINITION.
      PUBLIC SECTION.
        class-methods:
        handle_menu_buttons for event menu_button of cl_gui_alv_grid importing e_object e_ucomm,
        handle_USER_COMMAND for event user_command   of cl_gui_alv_grid importing e_ucomm,
    handle_toolbar for event toolbar of cl_gui_alv_grid importing e_object e_interactive.
    ENDCLASS.                    "lcl_event_receiver DEFINITION
          CLASS lcl_event_receiver IMPLEMENTATION
    CLASS lcl_event_receiver implementation.
      method handle_toolbar.
        move 'DETAIL-TAIL' TO IT_TOOLBAR-FUNCTION.
        MOVE ICON_DETAIL TO IT_TOOLBAR-ICON.
        MOVE 2 TO IT_TOOLBAR-BUTN_TYPE.
        APPEND IT_TOOLBAR TO E_OBJECT->MT_TOOLBAR.
      ENDMETHOD.                    "handle_toolbar
      METHOD HANDLE_MENU_BUTTONS.
        IF E_UCOMM = 'DETAIL-TAIL'.
          CALL METHOD e_object->add_function
            EXPORTING
              fcode = 'DISPLAY-TAIL'
              text  = 'DISPLAY'.
        ENDIF.
      ENDMETHOD.                    "HANDLE_MENU_BUTTONS
      METHOD handle_user_command.
        CASE E_UCOMM.
          WHEN 'DISPLAY-TAIL'.
            MESSAGE 'THESE IS TEST EVENT' TYPE 'I'.
            ENDCASE.
            ENDMETHOD.
            ENDCLASS.
    MODULE STATUS_1000 OUTPUT
    MODULE STATUS_1000 OUTPUT.
    SET PF-STATUS 'xxxxxxxx'.
    SET TITLEBAR 'xxx'.
    CREATE OBJECT CON
        EXPORTING
       PARENT                      =
          CONTAINER_NAME              = 'CO_CON'
       STYLE                       =
       LIFETIME                    = lifetime_default
       REPID                       =
       DYNNR                       =
       NO_AUTODEF_PROGID_DYNNR     =
    EXCEPTIONS
       CNTL_ERROR                  = 1
       CNTL_SYSTEM_ERROR           = 2
       CREATE_ERROR                = 3
       LIFETIME_ERROR              = 4
       LIFETIME_DYNPRO_DYNPRO_LINK = 5
       others                      = 6
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CREATE OBJECT GR_ALVGRID
        EXPORTING
        I_SHELLSTYLE      = 0
        I_LIFETIME        =
          I_PARENT           =  CON
        I_APPL_EVENTS     = space
        I_PARENTDBG       =
        I_APPLOGPARENT    =
        I_GRAPHICSPARENT  =
        I_NAME            =
        I_FCAT_COMPLETE   = SPACE
      EXCEPTIONS
        ERROR_CNTL_CREATE = 1
        ERROR_CNTL_INIT   = 2
        ERROR_CNTL_LINK   = 3
        ERROR_DP_CREATE   = 4
        others            = 5
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      WA_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_MAXIMUM.
      APPEND WA_EXCLUDE TO ITAB_EXCLUDE.
      WA_EXCLUDE = CL_GUI_ALV_GRID=>MC_mb_SUM.
      APPEND WA_EXCLUDE TO ITAB_EXCLUDE.
    CALL METHOD GR_ALVGRID->SET_TABLE_FOR_FIRST_DISPLAY
        EXPORTING
       I_BUFFER_ACTIVE               =
       I_BYPASSING_BUFFER            =
       I_CONSISTENCY_CHECK           =
          I_STRUCTURE_NAME              = 'MARA'
       IS_VARIANT                    =
       I_SAVE                        =
       I_DEFAULT                     = 'X'
       IS_LAYOUT                     =
       IS_PRINT                      =
       IT_SPECIAL_GROUPS             =
          IT_TOOLBAR_EXCLUDING          = ITAB_EXCLUDE
       IT_HYPERLINK                  =
       IT_ALV_GRAPHICS               =
       IT_EXCEPT_QINFO               =
       IR_SALV_ADAPTER               =
        CHANGING
          IT_OUTTAB                     = ITAB[]
       IT_FIELDCATALOG               =
       IT_SORT                       =
       IT_FILTER                     =
    EXCEPTIONS
       INVALID_PARAMETER_COMBINATION = 1
       PROGRAM_ERROR                 = 2
       TOO_MANY_LINES                = 3
       others                        = 4
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CREATE OBJECT event_receiver.
      SET HANDLER  event_receiver->handle_menu_buttons
                  event_receiver->handle_toolbar
                  event_receiver->handle_user_command
                  FOR ALL INSTANCES.
      CALL METHOD GR_ALVGRID->set_toolbar_interactive.
    ENDMODULE.                 " STATUS_1000  OUTPUT
    *&      Module  USER_COMMAND_1000  INPUT
          text
    MODULE USER_COMMAND_1000 INPUT.
    ENDMODULE.                 " USER_COMMAND_1000  INPUT

  • Instead of trigger example - INSERT works but UPDATE and DELETE does not?

    Below is a demostration script of what I am trying to troubleshoot. Tests are done on 10gR2;
    conn system/system
    drop table tt purge ;
    create table tt nologging as select * from all_users ;
    alter table tt add constraint pk_tt_user_id primary key (user_id) nologging ;
    analyze table tt compute statistics for table for all indexed columns ;
    conn hr/hr
    drop database link dblink ;
    create database link dblink
    connect to system identified by system
    using 'xe.turkcell' ;
    select * from global_name@dblink ;
    drop view v_tt ;
    create view v_tt as select username, user_id, created from tt@dblink order by 2 ;
    select count(*) from v_tt ;
    COUNT(*)
    13
    drop sequence seq_pk_tt_user_id ;
    create sequence seq_pk_tt_user_id
    minvalue 1000 maxvalue 99999
    increment by 1;
    create synonym tt for tt@dblink ;
    CREATE OR REPLACE PROCEDURE prc_update_tt(old_tt v_tt%ROWTYPE, new_tt v_tt%ROWTYPE) IS
    BEGIN
    IF old_tt.user_id != new_tt.user_id THEN
    RETURN; -- primary key
    END IF;
    IF old_tt.user_id IS NOT NULL AND new_tt.user_id IS NULL THEN
    DELETE FROM tt
    WHERE user_id = nvl(old_tt.user_id,
    -99);
    RETURN;
    END IF;
    IF (old_tt.username IS NULL AND new_tt.username IS NOT NULL) OR
    (old_tt.username IS NOT NULL AND new_tt.username != old_tt.username) THEN
    UPDATE tt
    SET username = new_tt.username
    WHERE user_id = nvl(old_tt.user_id,
    -99);
    END IF;
    IF (old_tt.created IS NULL AND new_tt.created IS NOT NULL) OR
    (old_tt.created IS NOT NULL AND new_tt.created != old_tt.created) THEN
    UPDATE tt
    SET created = new_tt.created
    WHERE user_id = nvl(old_tt.user_id,
    -99);
    END IF;
    END prc_update_tt;
    CREATE OR REPLACE PROCEDURE prc_insert_tt(old_tt v_tt%ROWTYPE, new_tt v_tt%ROWTYPE) IS
    new_tt_user_id NUMBER;
    BEGIN
    SELECT seq_pk_tt_user_id.NEXTVAL INTO new_tt_user_id FROM dual;
    INSERT INTO tt
    (username, user_id, created)
    VALUES
    (new_tt.username, new_tt_user_id, new_tt.created);
    END prc_insert_tt;
    CREATE OR REPLACE PROCEDURE prc_delete_tt(old_tt v_tt%ROWTYPE, new_tt v_tt%ROWTYPE) IS
    BEGIN
    DELETE FROM tt
    WHERE user_id = nvl(old_tt.user_id,
    -99);
    END prc_delete_tt;
    CREATE OR REPLACE TRIGGER trg_iof_v_tt
    INSTEAD OF UPDATE OR INSERT OR DELETE ON v_tt
    FOR EACH ROW
    DECLARE
    new_tt v_tt%ROWTYPE;
    old_tt v_tt%ROWTYPE;
    BEGIN
    dbms_output.put_line('INSTEAD OF TRIGGER fired');
    dbms_output.put_line(':NEW.user_id ' || :NEW.user_id);
    dbms_output.put_line(':OLD.user_id ' || :OLD.user_id);
    dbms_output.put_line(':NEW.username ' || :NEW.username);
    dbms_output.put_line(':OLD.username ' || :OLD.username);
    dbms_output.put_line(':NEW.created ' || :NEW.created);
    dbms_output.put_line(':OLD.created ' || :OLD.created);
    new_tt.user_id := :NEW.user_id;
    new_tt.username := :NEW.username;
    new_tt.created := :NEW.created;
    old_tt.user_id := :OLD.user_id;
    old_tt.username := :OLD.username;
    old_tt.created := :OLD.created;
    IF inserting THEN
    prc_insert_tt(old_tt,
    new_tt);
    ELSIF updating THEN
    prc_update_tt(old_tt,
    new_tt);
    ELSIF deleting THEN
    prc_delete_tt(old_tt,
    new_tt);
    END IF;
    END trg_iof_v_tt;
    set serveroutput on
    set null ^
    insert into v_tt values ('XXX', -1, sysdate) ;
    INSTEAD OF TRIGGER fired
    :NEW.user_id -1
    :OLD.user_id
    :NEW.username XXX
    :OLD.username
    :NEW.created 30/01/2007
    :OLD.created
    1 row created.
    commit ;
    select * from v_tt where username = 'XXX' ;
    USERNAME USER_ID CREATED
    XXX 1000 31/01/2007          <- seems to be no problem with insert part but
    update v_tt set username = 'YYY' where user_id = 1000 ;
    INSTEAD OF TRIGGER fired
    :NEW.user_id
    :OLD.user_id
    :NEW.username YYY
    :OLD.username
    :NEW.created
    :OLD.created
    1 row updated.
    commit ;
    select count(*) from v_tt where username = 'YYY' ;
    COUNT(*)
    0               <- here is my first problem with update part, Oracle said "1 row updated."
    delete from v_tt where user_id = 1000 ;
    INSTEAD OF TRIGGER fired
    :NEW.user_id
    :OLD.user_id
    :NEW.username
    :OLD.username
    :NEW.created
    :OLD.created
    1 row deleted.
    commit ;
    select count(*) from v_tt ;
    COUNT(*)
    14               <- here is my second problem with delete part, Oracle said "1 row deleted."
    Any comments will be welcomed, thank you.
    Message was edited by:
    TongucY
    changed "-1" values to "1000" in the where clause of delete and update statements.
    it was a copy/paste mistake, sorry for that.

    What table do you process in your procedures ? You don't use DBLINK to
    reference remote table in your procedures.
    Seems, you have table "TT" in "HR" schema too.
    Look:
    SQL> create table tt nologging as select * from all_users where rownum <=3;
    Table created.
    SQL> select * from tt;
    USERNAME                          USER_ID CREATED
    SYS                                     0 25-APR-06
    SYSTEM                                  5 25-APR-06
    OUTLN                                  11 25-APR-06
    SQL> conn scott/tiger
    Connected.
    SQL> create database link lk65 connect to ... identified by ... using 'nc65';
    Database link created.
    SQL> select * from tt@lk65;
    USERNAME                          USER_ID CREATED
    SYS                                     0 25-APR-06
    SYSTEM                                  5 25-APR-06
    OUTLN                                  11 25-APR-06
    SQL> create view v_tt as select username, user_id, created from tt@lk65 order by 2;
    View created.
    SQL> select * from v_tt;
    USERNAME                          USER_ID CREATED
    SYS                                     0 25-APR-06
    SYSTEM                                  5 25-APR-06
    OUTLN                                  11 25-APR-06
    SQL> create sequence seq_pk_tt_user_id
      2  minvalue 1000 maxvalue 99999
      3  increment by 1;
    Sequence created.
    SQL> CREATE OR REPLACE PROCEDURE prc_insert_tt(old_tt v_tt%ROWTYPE, new_tt v_tt%ROWTYPE) IS
      2  new_tt_user_id NUMBER;
      3  BEGIN
      4  SELECT seq_pk_tt_user_id.NEXTVAL INTO new_tt_user_id FROM dual;
      5  INSERT INTO tt
      6  (username, user_id, created)
      7  VALUES
      8  (new_tt.username, new_tt_user_id, new_tt.created);
      9  END prc_insert_tt;
    10  /
    Warning: Procedure created with compilation errors.
    SQL> show error
    Errors for PROCEDURE PRC_INSERT_TT:
    LINE/COL ERROR
    5/1      PL/SQL: SQL Statement ignored
    5/13     PL/SQL: ORA-00942: table or view does not exist
    SQL> edit
    Wrote file afiedt.buf
      1  CREATE OR REPLACE PROCEDURE prc_insert_tt(old_tt v_tt%ROWTYPE, new_tt v_tt%ROWTYPE) IS
      2  new_tt_user_id NUMBER;
      3  BEGIN
      4  SELECT seq_pk_tt_user_id.NEXTVAL INTO new_tt_user_id FROM dual;
      5  INSERT INTO tt@lk65
      6  (username, user_id, created)
      7  VALUES
      8  (new_tt.username, new_tt_user_id, new_tt.created);
      9* END prc_insert_tt;
    SQL> /
    Procedure created.Rgds.

  • EC-CS Cons Chart of Accounts & Financial Statment Version

    Hi Experts,
    I need your valid input on this issue. We have 6 company codes and wanted to have a consolidation P&L and BS. I have implemented EC-CS and have done all the all necessary configuration and the data is flowing to EC-CS without any problems. My concern here is whether i have done right in Cons chart of accounts or not. I have created one consolidated chart of accounts in FI which as 1:1 relationship with operational coa and also copied Financial statment version. But for some reason the FSV is not copied correctly to EC-CS in FS hierarchy for example under assets->current assets->cash i just get the group as cash but it doesnt bring all the FS items or GL accounts under it, where as FI i can see all the GL accounts under cash. My question here is how to copy the same FSV from FI to EC-CS as FS hierarchy.
    Since I am using 1:1 relationship between consolidated coa and operation coa, what's the best way bring all the GL accounts in FI to EC-CS as FS item including the financial statment version. I went to CX16 and transfered automatically from FSV, it just brought in the higher level groups and not the lower level FS item.
    Could somebody suggest me the better way of doing it or am i doing something wrong? Another question is how does the retained earnings work, does it work the same way as FI, transfering net income/loss from p&l to BS, since the data is transfered from FI on real time update?
    Thanks in advance
    Best Regards,
    gj

    Hi Dan,
    Thanks again. I did figured it out and i was able to post the retaining earning account. Simultenously I was trying to post a reclassification  and i am getting error message GK897 (Auto posting item 0000330000 contains wrong value (cons unit 000000000000003200). Basically in the reclassification rule, i specified the percentage rate in further settings and in trigger i had given the P&L retained earning account, source as RE account and destination as another FS item. The reason behind doing this to take certain percentage of RE account and to reclassify to another account. but im getting this error message, im not sure what i am missing here.
    thanks
    Best Regards,
    gj

  • Java function call from Trigger in Oracle

    Moderator edit:
    This post was branched from an eleven-year-old long dead thread
    Java function call from Trigger in Oracle
    @ user 861498,
    For the future, if a forum discussion is more than (let's say) a month old, NEVER resurrect it to append your new issue. Always start a new thread. Feel free to include a link to that old discussion if you think it might be relevant.
    Also, ALWAYS use code tags as is described in the forum FAQ that is linked at the upper corner of e\very page. Your formulae will be so very much more readable.
    {end of edit, what follows is their posting}
    I am attempting to do a similar function, however everything is loaded, written, compiled and resolved correct, however, nothing is happening. No errors or anything. Would I have a permission issue or something?
    My code is the following, (the last four lines of java code is meant to do activate a particular badge which will later be dynamic)
    Trigger:
    CREATE OR REPLACE PROCEDURE java_contact_t4 (member_id_in NUMBER)
    IS LANGUAGE JAVA
    NAME 'ThrowAnError.contactTrigger(java.lang.Integer)';
    Java:
    CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "ThrowAnError" AS
    // Required class libraries.
    import java.sql.*;
    import oracle.jdbc.driver.*;
    import com.ekahau.common.sdk.*;
    import com.ekahau.engine.sdk.*;
    // Define class.
    public class ThrowAnError {
    // Connect and verify new insert would be a duplicate.
    public static void contactTrigger(Integer memberID) throws Exception {
    String badgeId;
    // Create a Java 5 and Oracle 11g connection.
    Connection conn = DriverManager.getConnection("jdbc:default:connection:");
    // Create a prepared statement that accepts binding a number.
    PreparedStatement ps = conn.prepareStatement("SELECT \"Note\" " +
    "FROM Users " +
    "WHERE \"User\" = ? ");
    // Bind the local variable to the statement placeholder.
    ps.setInt(1, memberID);
    // Execute query and check if there is a second value.
    ResultSet rs = ps.executeQuery();
    while (rs.next()) {
    badgeId = rs.getString("Note");
    // Clean up resources.
    rs.close();
    ps.close();
    conn.close();
    // davids badge is 105463705637
    EConnection mEngineConnection = new econnection("10.25.10.5",8550);
    mEngineConnection.setUserCredentials("choff", "badge00");
    mEngineConnection.call("/epe/cfg/tagcommandadd?tagid=105463705637&cmd=mmt%203");
    mEngineConnection.call("/epe/msg/tagsendmsg?tagid=105463705637&messagetype=instant&message=Hello%20World%20from%20Axium-Oracle");
    Edited by: rukbat on May 31, 2011 1:12 PM

    To followup on the posting:
    Okay, being a oracle noob, I didn't know I needed to tell anything to get the java error messages out to the console
    Having figured that out on my own, I minified my code to just run the one line of code:
    // Required class libraries.
      import java.sql.*;
      import oracle.jdbc.driver.*;
      import com.ekahau.common.sdk.*;
      import com.ekahau.engine.sdk.*;
      // Define class.
      public class ThrowAnError {
         public static void testEkahau(Integer memberID) throws Exception {
         try {
              EConnection mEngineConnection = new EConnection("10.25.10.5",8550);
         } catch (Throwable e) {
              System.out.println("got an error");
              e.printStackTrace();
    }So, after the following:
    SQL> {as sysdba on another command prompt} exec dbms_java.grant_permission('AXIUM',"SYS:java.util.PropertyPermission','javax.security.auth.usersubjectCredsOnly','write');
    and the following as the user
    SQL> set serveroutput on
    SQL> exec dbms_java.set_output(10000);
    I run the procedure and receive the following message.
    SQL> call java_contact_t4(801);
    got an error
    java.lang.NoClassDefFoundError
         at ThrowAnError.testEkahau(ThrowAnError:13)
    Call completed.
    NoClassDefFoundError tells me that it can't find the jar file to run my call to EConnection.
    Now, I've notice when I loaded the sdk jar file, it skipped some classes it contained:
    c:\Users\me\Documents>loadjava -r -f -v -r "axium/-----@axaxiumtrain" ekahau-engine-sdk.jar
    arguments: '-u' 'axium/***@axaxiumtrain' '-r' '-f' '-v' 'ekahau-engine-sdk.jar'
    creating : resource META-INF/MANIFEST.MF
    loading : resource META-INF/MANIFEST.MF
    creating : class com/ekahau/common/sdk/EConnection
    loading : class com/ekahau/common/sdk/EConnection
    creating : class com/ekahau/common/sdk/EErrorCodes
    loading : class com/ekahau/common/sdk/EErrorCodes
    skipping : resource META-INF/MANIFEST.MF
    resolving: class com/ekahau/common/sdk/EConnection
    skipping : class com/ekahau/common/sdk/EErrorCodes
    skipping : class com/ekahau/common/sdk/EException
    skipping : class com/ekahau/common/sdk/EMsg$EMSGIterator
    skipping : class com/ekahau/common/sdk/EMsg
    skipping : class com/ekahau/common/sdk/EMsgEncoder
    skipping : class com/ekahau/common/sdk/EMsgKeyValueParser
    skipping : class com/ekahau/common/sdk/EMsgProperty
    resolving: class com/ekahau/engine/sdk/impl/LocationImpl
    skipping : class com/ekahau/engine/sdk/status/IStatusListener
    skipping : class com/ekahau/engine/sdk/status/StatusChangeEntry
    Classes Loaded: 114
    Resources Loaded: 1
    Sources Loaded: 0
    Published Interfaces: 0
    Classes generated: 0
    Classes skipped: 0
    Synonyms Created: 0
    Errors: 0
    .... with no explanation.
    Can anyone tell me why it would skip resolving a class? Especially after I use the -r flag to have loadjava resolve it upon loading.
    How do i get it to resolve the entire jar file?
    Edited by: themadprogrammer on Aug 5, 2011 7:15 AM
    Edited by: themadprogrammer on Aug 5, 2011 7:21 AM
    Edited by: themadprogrammer on Aug 5, 2011 7:22 AM
    Edited by: themadprogrammer on Aug 5, 2011 7:23 AM
    Edited by: themadprogrammer on Aug 5, 2011 7:26 AM

  • Is there an AUDIT option like AFTER SERVERERROR database trigger?

    I want to log any and every error-exception in a test database for a period.
    I have seen DBMS_UTILITY.FORMAT_ERROR_BACKTRACE article published on Oracle Magazine;
    http://www.oracle.com/technology/oramag/oracle/05-mar/o25plsql.html
    But before trying to build a custom application like this one;
    http://apex.oracle.com/pls/otn/f?p=2853:4:1160653345033883::NO::P4_QA_ID:5922
    1- I wanted to be sure if there is a specific WHENEVER NOT SUCCESSFUL Audit option for this need?
    2- Also is there a way to capture NO_DATA_FOUND exception with AFTER SERVERERROR database trigger?
    Thank you,
    Best regards.

    some stuff like following;
    1)
    -- the right one is conn hr/hr
    conn hr/eychar
    2)
    -- the right one is grant select on employees to public;
    grant select onnnn employees to public;
    3)
    create or replace procedure p1 as
    begin
    raise_Application_error(-20001, 'catch me if you can');
    end;
    exec p1;
    again thank you for your interest Michaels.

  • HOW TO TRIGGER AN WORKFLOW FROM A PROGRAM ?

    HELLO THERE ,
    CAN ANYBODY PLZ TELL ME HOW TO TRIGGER AN WORKFLOW FROM AN PROGRAM AND TO PAS THE VALUE TO THE CONTAINER ?

    Hello Neon,
    If you want to trigger the workflow directly, use the FM, SWU_START_WORKFLOW
    CALL FUNCTION 'SWU_START_WORKFLOW'
      EXPORTING
        task                  =
    *   LANGUAGE              = SY-LANGU
        user                  =
    *   SENDER_ID             =
    * IMPORTING
    *   RETURN_CODE           =
    *   WORKITEM_ID           =
      tables
    *   CONTAINER             =
    *   MESSAGE_LINES         =
        attachment_list       =
    A workflow can also be triggered by and event which is in turn triggered by a program.
    By the FM, SWE_CREATE_EVENT
    Example:
    w_key = 'Connie'.
      w_creator-otype = 'US'.
      w_creator-objid = 'SAPDEV02'.
      CALL FUNCTION 'SWE_EVENT_CREATE'
        EXPORTING
          objtype                       = 'YH_BUDDIES'
          objkey                        = w_key
          event                         = 'event'
         creator                        = w_creator
    *     TAKE_WORKITEM_REQUESTER       = ' '
    *     START_WITH_DELAY              = ' '
    *     START_RECFB_SYNCHRON          = ' '
    *     NO_COMMIT_FOR_QUEUE           = ' '
    *     DEBUG_FLAG                    = ' '
    *     NO_LOGGING                    = ' '
    *     IDENT                         =
    *   IMPORTING
    *     EVENT_ID                      =
    *   TABLES
    *     EVENT_CONTAINER               =
       EXCEPTIONS
         objtype_not_found              = 1
         OTHERS                         = 2
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ELSE.
        WRITE: / 'EVENT TRIGGERED'.
      ENDIF.
      COMMIT WORK.
    Hope it helps you.
    Regards
    Indu.

  • Where is the location of the trigger's message

    I want to find the following trigger's message , as well edit it.
    U2$FORM_ERRORS.PUSH('CON-12210', 'I', 'OFG', 0);
    RAISE FORM_TRIGGER_FAILURE;
    ***message content like that "information:your invoice data is not found for this query..."***
    I couldn't see any message in the forms file(also database).
    is it located at library?
    or
    is it located at the repository? if say so, would you tell me how to go there?
    thank you so much in advance.
    p.s.
    I do find some package in the library(procedure,function)
    I can not find the message written..
    " U2$FORM_ERRORS.PUSH(err_type||'-'||to_char(err_code)||': '||server_msg, 'M', 'OFG', 0);
        U2$FORM_ERRORS.RAISE_FAILURE;"
    PACKAGE U2$form_errors IS
    procedure raise_failure;
    procedure push(msg      in varchar2,
                    p_error    in varchar2 default 'I',
                    msg_type in varchar2 default '',
                    msgid    in integer  default 0,
                    loc      in varchar2 default '');
    [/PRE]Message was edited by:
            Jin
    Message was edited by:
            Jin
    Message was edited by:
            Jin                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Is this from Oracle Applications? You might have better luck asking there. I would guess that u2$form_errors is a package, probably in a library.

  • How do I add a video time trigger to control other symbols?

    I would like to use a video to trigger when other Symbols appear on the Stage at different times in the video. I've used the following code:
           var vid = sym.$("VideoSymbolName")[0];
           vid.addEventListener("timeupdate", function() {
                 if (this.currentTime >= 4) {
                   // Do Something This code loads a symbol into a container
                      var firstS = sym.createChildSymbol("SymbolName", "ContainerName");
            }, false);
    However, that loads the picture repeatedly, and several instances appear on the stage, so I tried using this code:
           var vid = sym.$("VideoSymbolName")[0];
           vid.addEventListener("timeupdate", function() {
                 if (this.currentTime >= 4) {
                   // Do Something This code loads a symbol into a container
                    var con= sym.$("PicPortal");
                    con.empty();
                      var firstS = sym.createChildSymbol("SymbolName", "ContainerName");
            }, false);
    However, that makes the loaded Symbol "flash", as it is constantly loaded and unloaded in the container.
    Any other ideas?
    Thanks

    The only method available to show current time in Keynote used Quartz Composer, however the current version of Keynote 6.2, does not support Quartz.

  • CREATING A TRIGGER THAT PICKS UP THE LAST INSERTED RECORD

    Hello everybody
    my question. is it possible to embed a sql query whitin a trigger? the thing is that when I have to insert the value, this actually would have to be retrieved from another table. It is an AFTER INSERT, but it needs to know which name I inserted in table 1 in order to also insert it into table 2.
    More specifically. Imagine a table with usernames and passwords that I populate as I set them up
    Then I need a trigger that as it sees that I have entered that username it takes it and populates another table with that plus a generated sequence that could be the result of some string function
    CREATE OR REPLACE
    TRIGGER GENERATE_SEQUENCE
    AFTER INSERT ON USERS_TABLE
    FOR EACH ROW
    BEGIN
    insert into GENERATED_SEQUENCES_TABLE (lastinserted_name,surrogate_key)
    values(SELECT USERNAME FROM USERS_TABLE WHERE USERID....., SUBSTR (lastinsertedname¦¦ password), 1,12);
    END;
    so, this lastinserted name is what I am trying to retrieve. I mean if it is not madness to insert a sql query in the way I have done it, I could write in the query to select the highest ID from the PK and that would give me the last inserted name.
    thanks a lot
    Alvaro

    In an insert trigger you can reference all the inserting values with :new.column_name, hence there's no need to select from the USERS_TABLE table:
    CREATE OR REPLACE
    TRIGGER GENERATE_SEQUENCE
    AFTER INSERT ON USERS_TABLE
    FOR EACH ROW
    BEGIN
    insert into GENERATED_SEQUENCES_TABLE (lastinserted_name,surrogate_key)
    values(:new.USERNAME, ...);
    END;
    /Max
    [My Italian Oracle blog|http://oracleitalia.wordpress.com/2010/02/05/gestione-degli-errori-in-sql-con-log-errors/]

  • Trigger giving no output

    hiii everybody,
    i executed the trigger shown below on my system's local database ,but trigger is showing no output,where i m wrong ?any HELP HIGHLY APPRECIATED,thanks and trigger is shown below.
    SQL> sho user;
    USER is "SYS"
    SQL> CREATE TABLE logonaudit
    2 (
    3 user_id VARCHAR2(30),
    4 sess_id NUMBER(10),
    5 logon_time DATE,
    6 logoff_time DATE,
    7 host VARCHAR2(20));
    Table created.
    SQL> CREATE OR REPLACE
    2 TRIGGER logon_audit
    3 AFTER LOGON
    4 ON DATABASE
    5 DECLARE
    6 V_program varchar2(120);
    7 BEGIN
    8 SELECT UPPER(program)
    9 INTO v_program
    10 FROM v$session
    11 WHERE audsid = sys_context('USERENV','SESSIONID');
    12 if upper(v_program) in ('TOAD','SQLPLUS')
    13 then
    14 INSERT
    15 INTO logonaudit
    16 VALUES(
    17 user,
    18 sys_context('userenv','sessionid'),
    19 sysdate,
    20 null,
    21 sys_context('userenv','host')
    22 );
    23 end if;
    24 END;
    25 /
    Trigger created.
    SQL> conn scott/tiger;
    Connected.
    SQL> conn /as sysdba
    Connected.
    SQL> select * from logonaudit;
    no rows selected
    SQL>
    Edited by: 938946 on Dec 24, 2012 11:00 PM
    Edited by: 938946 on Dec 24, 2012 11:01 PM

    Hi,
    As you are able to connect as SYS, you can query directly v$session and see that the value of PROGRAM column for sessions using SQLPLUS to connect to the database is sqlplus.exe. So, if you change, in your trigger, the condition if upper(v_program) in ('TOAD','SQLPLUS') by if ( upper(v_program) like '%TOAD%' or upper(v_program) like '%SQLPLUS%' ), you'll see insertion in the table logonaudit.

  • How to create trigger through Java programm?

    I write a Java programm to create a trigger(through JDBC connection). After I run the programm, a trigger was created in Oracle 10g.But the trigger is invalid. After Compiling the trigger , a error "PLS-00103 " occured .But if I excute the SQL in SQL developer,the trigger was created successfully.
    If there is some special considerations should be taken when using programm to create trigger?
    My Java programm fragment as follows:
         public void createTrigger() throws SQLException{
              Statement stmt = conn.createStatement();
              stmt.executeUpdate(getCreateTriggerSql());
    Edited by: jerry on 2010-6-29 下午6:42

    Yes the special consideration is you shouldn't perform DDL on the fly, as it has all kinds of unwanted side effects like implicit commits.
    If I would start a company, and I discover one of my developers is writing this kind of program, I would fire him, on the spot.
    Sybrand Bakker
    Senior Oracle DBA

Maybe you are looking for

  • Loading data from xml file - please help

    Hi, I am new to attempting to get data from an xml file load in flash. I followed a tutorial in a new fla and it seemed to work fine, I then tried to adapt it to my own needs which worked fine. But then when trying to implement this into my news sect

  • How to calculate predictions using an MVAR model

    Hi All, I'm using an MVAR model (Least Squares). The AR VI in the Advanced signalprocessing toolbox calculates the regressionparameters and returns the noise that is not acounted for by the MVAR model. However I need the estimations too... So I tried

  • Is it possible Encrypt files in document library after uploading OOB

    Is it possible Encrypt files in document library after uploading using  OOB? if so please share how the above can be achieved. V Jean

  • Windows 7 and Blackberry Desktop 6

    I have written about this problem in the past, but found no help. Under Windows 7, Blackberry Desktop 5 works just fine, but Desktop 6 crashes as it attempts to sync with Yahoo. (Yes, I do remove 5 before installing 6.) The Event log shows the follow

  • Two Sites - 1 with .mac and one with another hosted provider

    Hi All, I have two sites in iWEB08, the second of which I want to publish to a folder. When I choose this option, it publishes both to a folder. Is there a way just to do the site I want? Thanks Rich