Database trigger problem

db 10g rel2 ,
i am trying to write this trigger :
{code}
CREATE OR REPLACE TRIGGER secure_emp
   BEFORE
   INSERT OR UPDATE OR DELETE
   ON emp
  BEGIN
   IF (TO_CHAR(SYSDATE,'DAY') IN ('thursday','friday')) OR
    (TO_CHAR(SYSDATE,'HH24:MI')  NOT BETWEEN '08:00' AND '18:00') THEN
    IF DELETING THEN RAISE_APPLICATION_ERROR(
     -20502,'You may delete from EMPLOYEES table only during business hours.');
   ELSIF INSERTING THEN RAISE_APPLICATION_ERROR(
    -20500,'You may insert into EMPLOYEES table only during business hours.');
   ELSIF UPDATING('SAL') THEN
   RAISE_APPLICATION_ERROR(-20503, 'You may update SALARY only during    business hours.');
   ELSE
   RAISE_APPLICATION_ERROR(-20504,'You may update EMPLOYEES table  during  normal hours.');
    END IF;
    END IF;
    END;
the result of the trigger is , inserting a record although the day is thursday ??
{code}
why does this happens ?
thanks

BluShadow wrote:
Or even better, use a suitable format mask on the TO_CHAR to remove trailing spaces...
This will not resolve NLS issues. For example, client in Germany will not get right result. OP should also use TO_CHAR third parameter:
SQL> alter session set nls_language=german
  2  /
Session altered.
SQL> select 'Yes' from dual where to_char(sysdate,'fmDAY') in ('THURSDAY','FRIDAY')
  2  /
no rows selected
SQL> select 'Yes' from dual where to_char(sysdate,'fmDAY','nls_date_language=english') in ('THURSDAY','FRIDAY')
  2  /
'YE
Yes
SQL>
SY.

Similar Messages

  • PROBLEM WITH A DATABASE TRIGGER

    WHEN A USER ENTERS A STATUS CODE BETWEEN 70 AND 86 ON THE PAB_SUSP TABLE, THE COMPLETION DATE FIELD ON THE PAB_SUSP TABLE GETS UPDATED WITH THE SYSTEM DATE WHICH IS FINE. THE
    COMPLETION DATE FIELD ON THE EREC_SUSP TABLE FOR THE SAME CORRESPONDING RECORD SHOULD ALSO GET UPDATED WITH THE SAME SYSTEM DATE. SOMETIMES THE COMPLETION DATE FIELD ON THE EREC_SUSP TABLE GETS UPDATED CORRECTLY WITH THE SAME SYSTEM DATE. OTHER TIMES IT DOES NOT. WHAT IS THE PROBLEM?
    I AM ENCLOSING THE CODE IN THE DATABASE TRIGGER. NOTE ALSO THAT THE SUSP_DT FIELD ALSO GETS UPDATED.
    DECLARE
    cursor get_user is SELECT user_id, FROM oracle_user
    WHERE username = USER;
    user_number NUMBER(10,0);
    num_recs NUMBER(10,0);
    num_rec_recs2 NUMBER(10,0);
    seq number(10,0);
    ssn VARCHAR2(9);
    nm VARCHAR2(27);
    dob DATE;
    pg VARCHAR2(2);
    rank VARCHAR2(2);
    act_cd VARCHAR2(3);
    clk NUMBER(10,0);
    recv_dt DATE;
    susp_dt DATE;
    cmpl_dt DATE;
    ocll VARCHAR2(7);
    tagd VARCHAR2(7);
    chg_ind VARCHAR@(1);
    BEGIN
    open get_user;
    fetch get_user into user_number;
    close get_user;
    IF (:new.lcl_pab_susp_stat_cd <> :old.lcl_pab_susp_stat_cd AND
    :new.lcl_pab_susp_stat_cd >= '70' AND
    :new.lcl_pab_susp_stat_cd <= '86') THEN
    cmpl_dt := sysdate;
    END IF;
    IF :new.lcl_susp_dt <> :old.lcl_susp_dt THEN
    chg_ind := 'Y';
    susp_dt := :new.lcl_susp_dt;
    else
    susp_dt := :old.lcl_susp_dt;
    END IF;
    seq := :new.pab_susp_seq;
    ssn := :new.ind_ssn;
    nm := :new.ind_nm;
    dob := :new.ind_dob;
    pg := :new.ind_pg_cd;
    rank := :new.mil_rank_cd;
    act_cd := :new.lcl_act_cd;
    clk := :new.lcl_act_clk_no;
    recv_dt := :new.lcl_recv_dt;
    ocll := :new.ocll_id;
    tagd := :new.tagd_id;
    SELECT COUNT(*) INTO num_recs2
    FROM EREC_SUSP
    WHERE SUSP_SEQ = :old.susp_seq;
    IF num_recs2 > 0 THEN
    UPDATE erec_susp
    SET pab_susp_seq = seq,
    ind_ssn = ssn,
    ind_nm = nm,
    ind_dob = dob,
    ind_pg_cd = pg,
    mil_rank_cd = rank,
    erec_ofc_act_cd = act_cd,
    erec_of_clk_no = clk,
    lcl_cmpl_dt = cmpl_dt,
    lcl_recv_dt = recv_dt,
    lcl_susp_dt = susp_dt,
    ocll_id = ocll,
    tagd_id = tagd,
    lcl_chg_ind = chg_ind,
    rec_tx_dt = SYSDATE,
    rec_tx_user_no = user_number
    where susp_seq = new.susp_seq;
    END IF;
    END;

    S. Wolicki, Oracle wrote:
    No, you cannot!!! NLS_CHARACTERSET is not a session parameter in Oracle.
    Assuming IBM MessageBroker connects through OCI, setting the NLS_LANG variable in its environment to .EE8ISO8859P2 could help. You should also review MessageBroker's documentation, especially any configuration parameters for Oracle, to see if the character set is not configurable there. There is nothing to be done on the Oracle side.
    By the way, can you name any particular characters that do not show up correctly and tell me what you see in place of them?
    -- SergiuszHi Sergiusz,
    I replace back and forth the accented characters, but for large queries, it takes a very long time:
    REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
    REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(c,'ő','&#x0151'),
    'Ő','&#x0150'),'ű','&#x0171'),'Ű','&#x0170'),'é','&#x00E9'),'É','&#x00C9'),'á','&#x00E1;'),'Á','&#x00C1'),
    'ú','&#x00FA'),'Ú','&#x00DA'),'ö','&#x00F6'),'Ö','&#x00D6'),'ü','&#x00FC'),
    'Ü','&#x00DC'),'ó','&#x00F3'),'Ó','&#x00C3'),'í','&#x00ED'),'Í','&#x00CD');
    (The semicolons let down for display.)I thought that I would change the nls_lang on the client side in a Java node but it is not sure that will work.
    Thank you for your answer.
    Sada
    Edited by: 1002028 on 2013.04.24. 13:48
    Edited by: 1002028 on 2013.04.24. 13:49

  • Form Navigation problem while firing Database trigger

    Hi,
    A Database trigger is made to fire when a field is updated via forms and the trigger will give an error if the user is not authorized to modify the data. Everything is working fine and the trigger gives an error as palnned. After the error is thrown, we are unable to navigate between the forms and in addition we are uanble to perform any sort of actions like querying, deleting and cancelling. On Occasion we get errors like I/O buffer error and the errors keep on changing for every update. Plz help me to resolve the issue.
    RgDs,
    M KVG

    In addition to the Error Message you are getting, it would be helpful to know which version of Oracle Forms you are using and how your application is deployed (Client/Server or Web). If you app is web deployed, then also include the Java Runtime Environment version and your web browser and version.
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • Primary Key - Generated by database TRIGGER

    Hi,
    I have a form with a block that is attached to a table. So far, nothing fancy :-)
    The Primary is generated with an ORACLE SEQUENCE. That is done at the TABLE level with a DATABASE trigger.
    So in the form, the primary field is not populated.
    Works fine. But if the user wants to UPDATE the forms content, right after they did an INITIAL commit, THEY CAN'T !!!!!!!!!!!
    How can I code this in the form?
    Is there a way to syncronize (populate) the primary key in the form with it's table content?
    If so, how do I query the table if I don't have the primary key value ?
    Thanks for ANY advise,
    Marc.

    Another solution is to use both a database trigger and a PRE-INSERT trigger in Forms.
    The database trigger should be something like
    CREATE TRIGGER INS_TABLENAME BEFORE INSERT ON TABLENAME
    FOR EACH ROW WHEN (new.ID IS NULL)
    BEGIN
    SELECT TABLENAME_SEQ.nextval INTO :new.ID FROM DUAL;
    END;
    and the PRE-INSERT trigger should be something like:
    SELECT TABLENAME_SEQ.nextval INTO :blockname.ID FROM DUAL;
    This way one solves the problem of DML RETURNING VALUE not working in Forms with Oracle version > 8 (does it work on version 8 as it is said to be? - i have not tested it anyway) and the use of other applications (SQL*Plus, JAVA, etc) without writing any code.

  • Column name as a variable in a database trigger

    I am trying to code a pre-insert database trigger to format all varchar2 columns entered into the triggering table. I am using a cursor to get all the relevant column names from all_tab_columns, but do not know how to refer to these values in combination with the ":new" construct within my code. The example below is a very simplified version of what I am trying to do ( it obviously will not work as it is):
    declare
    cursor column_cur is
    select column_name cn
    from all_tab_columns
    where table_name = 'TEMP_ASSESSMENT'
    and data_type = 'VARCHAR2';
    v_columnname varchar2(30);
    begin
    for column_rec in column_cur loop
    v_columnname := column_rec.cn;
    :new.v_columnname := upper(:new.v_columnname); declare
    cursor column_cur is
    select column_name cn
    from all_tab_columns
    where table_name = 'TABLE_X'
    and data_type = 'VARCHAR2';
    v_columnname varchar2(30);
    begin
    for column_rec in column_cur loop
    v_columnname := column_rec.cn;
    :new.v_columnname := upper(:new.v_columnname);
    end loop;
    end;

    Seems to me like the problem in this thread:
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:59412348055
    C.

  • How to activate JDBC debugging for SPRING 3.1? Oracle trigger problems ...

    Hi,
    I have some trigger problems. I created a trigger to update a certain column each time a new record is inserted or an existent record is updated. I use Oracle 10g. If I create the trigger and execute an insert query via the XE client everything works fine. However, when I use a spring 3.1 setup with Hibernate and OJDBC driver, I get an
    java.sql.SQLException: ORA-04098: trigger 'LOCALUSER_PROP_TRIG' is invalid and failed re-validation
    And if I execute a show error trigger query I get an invalid SQL query error.
    I can easily activate Hibernate debugging and I can see that the prepared statement by Hibernate is just fine, but I was wondering if I could see the full sql sent by the JDBC driver to the server. Maybe seeing the actual query sent to the server would provide new insight of what could be wrong in the Hibernate setup. Does any one what could be wrong and eventually how could setup jdbc to output debug info? Thanks a lot,
    Cristian

    Which platform is the database running on ??
    Other things you should check -
    when debugging the EJB, JDev
    3.1 looks through your IIOP connections to find the one to use.
    Make sure that the IIOP connection that JDev is using for the debugging matches the IIOP connection that the EJB client application is using.
    raghu
    null

  • About database trigger

    Suppose I have 2 tables A and B. There are about 40 table
    columns for table A and 30 table column for table B. Table A
    can insert, update and delete the record from table B. Table A
    can insert, update about 15 table columns into table B. I
    create database trigger on table A to insert, update and delete.
    TAble B can update only 1 table columns into table A. Due to
    these 2 tables A and B have update trigger. So it is mutating
    when I try to update the record from table A and also update the
    record in table B. Please if you have any suggestion, let me
    know. I try to work around by creating the package with
    variable field set to boolean. But, somehow it only allows to
    update from B to A, not from A to B. Thanks in advance.
    null

    Long Tran (guest) wrote:
    : Suppose I have 2 tables A and B. There are about 40 table
    : columns for table A and 30 table column for table B. Table A
    : can insert, update and delete the record from table B. Table A
    : can insert, update about 15 table columns into table B. I
    : create database trigger on table A to insert, update and
    delete.
    : TAble B can update only 1 table columns into table A. Due to
    : these 2 tables A and B have update trigger. So it is mutating
    : when I try to update the record from table A and also update
    the
    : record in table B. Please if you have any suggestion, let me
    : know. I try to work around by creating the package with
    : variable field set to boolean. But, somehow it only allows to
    : update from B to A, not from A to B. Thanks in advance.
    Hi, I've had this type of mutating table problem before ....
    Here's a workaround:
    1. Create temporary table to record the changes on the
    database triggers (row triggers). Then on a after statement
    issue the update statement.
    2. Crear package variables at the package specification. Then
    create procedures or functions to set this values accordingly
    (in before and after trigger statement). Finally use after
    statement triggers.
    null

  • After Logon on Database Trigger Not Working From Client Terminal

    Hi Every One
    I Have a Problem, I'am Using Oracle 10g R2, I'd Written After Logon on Database Trigger, I'd Written The Trigger Under The Under The User With DBA Privileges, and it is work Fine, but it is work only when i Logon On The Database from The Server Terminal with any user, and If Logon From any Other Terminal It Is Not Work,
    Can any One Know The Reason, Please Help me
    Yasser Mokhtar

    Please post the trigger code.

  • Could the Database Trigger get a forms variable value

    Hi All
    We have an ERP which connect all users of the system with a single schema (Database user name), We create a record for each user in the ERP itself to specify the privillages for each user
    I would like to make a database trigger to Audit a table , by storing the user name, action (Insert,delete,update) on an audit table.
    The problem is the user name i want to store is not the schema name, but it's stored in a database table and read in a global variable.
    Can i get the user name (which stored in the global variable) in the database trigger ???
    Thanks
    Mostafa Abolaynain

    If this global variable lives inside Forms (which the title of your post seems to indicate), then no.
    A database trigger can only reference "stuff" that lives inside the database session at the database server, not "stuff" that lives inside the proces at the client device.
    You should ask your ERP vendor: there might very well be something (eg. a variable inside a database package) that you can use.

  • DB Trigger Problem??

    Hi ,
    I have one problem :
    By using database trigger on EMP table I have to update the salary of all the subordinates by 10% if their Manager's Salary is incremented by 5%.
    I did it by using a package -that contains PL/SQL Table to store the Manager's Emp No those got increment and their old & new Salary.
    Before Update Trigger(Row-Level Trigger) to assign the values in the PL/SQL table. and
    After Update(statement Level Trigger)-That reads the manager's empno,old salary & new salary from PL/SQL table and update the EMP table for their Subordinates.
    But It gives me the Recursive SQl error.
    Pls Help Me ASAP
    Regards.
    Suneel

    There is a good reason for this behaviour. You are trying to automate something that probably shouldn't be automated. Consider:
    SELECT * FROM my_emp
    ID  JOB        MGR_FLAG  MGR  SAL
    1   PRESIDENT  Y              5000
    2   SALESMAN   Y         1    2500
    3   GRUNT      N         2    1400If I issue the following SQL :
    UPDATE my_emp
    SET    sal = sal*1.05
    WHERE  mgr_flag = 'Y'
    / what should happen? Well, employees 1 and 2 should get a 5% pay rise because they are managers. And employee 3 gets a 10% pay rise, because her manager got 5%. So far so cool. But hang on a moment, employee 2 is managed by employee 1 so, as employee 1 got a 5% pay rise, employee 2 is entitled to a 10% pay rise.
    Now, which order do these things get processed in? Because that might make a difference. As it happens, ((2500 * 1.05) * 1.10) = 2887.5 whereas ((2500 * 1.10) * 1.05) = 2887.5. So it doesn't make a difference, in this case.
    But Oracle doesn't know that. With a more complicated algorithm e.g.
    IF sal < 2700
    THEN sal := sal+100;
    ELSE sal := sal * 1.05; 
    END IF;the order the rows are processed in will make a difference. And because it is impossible to forecast beforehand in which order rows will get processed Oracle baulks. It only allows SQL which has predictable results.
    Furthermore, the logic is dubious. Is it right for employee 2 to receive two pay rises? Is it right for employee 3 to receive two pay rises as well?
    Sure, using AUTONOMOUS TRANSACTION will suppress the error message. But the logic of the design remains flawed. I hope you now understand why this is not a good idea.
    Cheers, APC

  • Before rename database trigger

    Hi!
    I have the following database trigger to catch
    alter table ... rename to ... statements:
    CREATE OR REPLACE TRIGGER CHECK_BEFORERENAME
    BEFORE RENAME
    ON DATABASE
    BEGIN
    END;
    The problem is it doesn't fire on this statement although the Oracle 9i documentation states that we should
    "Specify RENAME to fire the trigger whenever a RENAME statement changes the name of a database object".
    What's the problem?
    Thx!

    Because you're triggering on RENAME but issuing an ALTER statement. The RENAME trigger will only catch statements like RENAME X TO Y.

  • Mutating DB Trigger Problem

    Hello all, i have a ' Mutating DB Trigger Problem' for the following Trigger :
    =============================================
    CREATE OR REPLACE TRIGGER ASSIUT.EMP_ATTENDANCEE_MONA
    AFTER INSERT
    ON ASSIUT.ACCESSLOG
    REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    DECLARE
    V_COUNT CHAR(2);
    --V_COUNT_OUT CHAR(2);
    BEGIN
    IF :NEW.INOUT = 'IN' THEN
        INSERT INTO EMP_ATTENDANCEE (EMP_ID, DATE_IN ,DATE_OUT ,TIME_IN ,TIME_OUT)
         VALUES (TO_NUMBER(TO_CHAR(:NEW.employeeid,99999)),
                 TO_DATE(:NEW.LOGDATE,'dd/mm/rrrr'),       -- DATE_IN
                 NULL,
                 TO_DATE(:NEW.LOGTIME,'HH24:MI:SS'),      -- TIME_IN
                 NULL );      -- TIME_OUT
                     SELECT COUNT(employeeid )
                     INTO V_COUNT
                    FROM ACCESSLOG
                    WHERE employeeid =:NEW.employeeid
                    AND LOGDATE =:NEW.LOGDATE
                    AND  LOGTIME  =:NEW.LOGTIME
                    AND INOUT ='IN';
                    IF V_COUNT > 0 THEN
         INSERT INTO ATT_INCOMPLETE  (  EMP_ID , ATT_DATE , ATT_TIME ,  ATT_FLAG)
         VALUES (TO_NUMBER(TO_CHAR(:NEW.employeeid,99999)),
                 TO_DATE(:NEW.LOGDATE,'dd/mm/rrrr'),       -- DATE_IN
          TO_DATE(:NEW.LOGTIME,'HH24:MI:SS'),        -- TIME_IN
          1); -- check in
          END IF;
    ELSIF :NEW.INOUT = 'OUT' THEN
        UPDATE  EMP_ATTENDANCEE
        SET           DATE_OUT   =  TO_DATE(:NEW.LOGDATE,'dd/mm/rrrr'), -- DATE_OUT,
                      TIME_OUT   =   TO_DATE(:NEW.LOGTIME,'HH24:MI:SS') -- TIME_OUT
        WHERE   EMP_ID           =   TO_NUMBER(TO_CHAR(:NEW.employeeid,99999))
        AND DATE_IN =  (SELECT MAX (DATE_IN )
                        FROM EMP_ATTENDANCEE
                        WHERE EMP_ID = EMP_ID
                        AND   DATE_OUT IS NULL
                        AND   TIME_OUT IS NULL ) ;
                  SELECT COUNT(employeeid )
                     INTO V_COUNT
                    FROM ACCESSLOG
                    WHERE employeeid =:NEW.employeeid
                    AND LOGDATE =:NEW.LOGDATE
                    AND  LOGTIME  =:NEW.LOGTIME
                    AND INOUT ='OUT';
                    IF V_COUNT > 0 THEN
    INSERT INTO ATT_INCOMPLETE  (  EMP_ID , ATT_DATE , ATT_TIME ,  ATT_FLAG)
         VALUES (TO_NUMBER(TO_CHAR(:NEW.employeeid,99999)),
                 TO_DATE(:NEW.LOGDATE,'dd/mm/rrrr'),       -- DATE_IN
          TO_DATE(:NEW.LOGTIME,'HH24:MI:SS'),        -- TIME_IN
         0); -- check in
    END IF;
    END IF;
      EXCEPTION
       WHEN OTHERS  THEN RAISE;
    END EMP_ATTENDANCEE_MONA ;The above Trigger generates the following error:
    ORA-04091: table ASSIUT.ACCESSLOG is mutating, trigger/function may not see it
    ORA-06512: at "ASSIUT.EMP_ATTENDANCEE_MONA'", line 65
    ORA-04088: error during execution of trigger 'ASSIUT.EMP_ATTENDANCEE_MONA'i want an easy and a straight forward solution to this problem which occured on selecting or manipulating from the same table i triggered it.
    Best regards,
    Abdetu..

    Create a package
    CREATE OR REPLACE PACKAGE PK_TRIGGER IS
      PROCEDURE PR_BS;
      PROCEDURE PR_ARIU(i_vcType IN TABLE.COLUM%TYPE, i_nEmpId TABLE.COLUM%TYPE, i_vcLogDate IN TABLE.COLUMN%TYPE, i_vcLogTime IN TABLE.COLUMN%TYPE);
      PROCEDURE PR_AS;
    END;
    CREATE OR REPLACE PACKAGE BODY IS
      TYPE tData IS RECORD (
        vcType     TABLE.COLUMN%TYPE,
        nEmpid     TABLE.COLUMN%TYPE,
        vcLogDate TABLE.COLUMN%TYPE,
        vcLogTime TABLE.COLUMN%TYPE
      TYPE tDataList IS TABLE OF tData INDEX BY BINARY_INTEGER;
      lData tData;
      PROCEDURE PR_BS IS
      BEGIN
        lData.DELETE;
      END;
      PROCEDURE PR_ARIU(i_vcType IN TABLE.COLUM%TYPE, i_nEmpId TABLE.COLUM%TYPE, i_vcLogDate IN TABLE.COLUMN%TYPE, i_vcLogTime IN TABLE.COLUMN%TYPE) IS
        iPos PLS_INTEGER:=lData.COUNT+1;
      BEGIN
        lData(iPos).vcType:=i_vcType;
        lData(iPos).nEmpId:=i_nEmpId;
        lData(iPos).vcLogDate:=i_vcLogDate;
        lData(iPos).vcLogTime:=i_vcLogTime;
      END;
      PROCEDURE PR_AS IS
        CURSOR crCheck(i_nIdentnum IN NUMBER) IS
          SELECT 1
            FROM <YOURTABLE> A,
                 <YOURTABLE> B
           WHERE A.IDEN_NUM=B.IDENT_NUM
             AND (   A.BEGIN_DATE BETWEEN B.BEGIN_DATE AND B.END_DATE
                  OR A.END_DATE BETWEEN B.BEGIN_DATE AND B.END_DATE
        iPos PLS_INTEGER;
        nDummy NUMBER;
      BEGIN
        iPos:=lData.FIRST;
        LOOP
          EXIT WHEN iPos IS NULL;
          -- Do whatever you want with the data in the record
          -- Process next record
          iPos:=lIds.NEXT(iPos);
        END LOOP;
        lIds.DELETE;
      END;
    END;replace TABLE.COLUM%TYPE with appropiate table and column
    Now create a
    - Before Statement trigger on your table calling PK_TRIGGER.PR_BS;
    - After Insert on Update for each row Trigger calling PK_TRIGGER.PR_ARIU(...values...);
    - After Statement trigger on your table calling PK_TRIGGER.PR_AS;
    Hope the code compiles for i have no database at hand.
    Andreas

  • Administer database trigger - ora-01031

    hello,
    I have problem with my trigger. I want change schema for users, witch logon on database. I put trigger in forms when I make new users and I now that this trigger is ok, but I get error ora-01031. I put privileges (administer database trigger)for user witch execute this trigger and I still get this error.
    I heard that must by sys as sysdba but I don't think so.
    any idea?
    regards

    You are right. I check this. thanks
    This was good idea but, not work.
    GRANT ALTER SESSION TO SCOTT;
    If I log on to scott and I fire trigger I get this error ORA-01301.
    another solutions? Maybe I make samphing wrong?
    regards
    Edited by: user515960 on 2010-06-25 09:43
    I make this
    GRANT CREATE ANY TRIGGER TO SCOTT; and now work. but I now that must be grant alter session too.
    thank for all
    Edited by: user515960 on 2010-06-25 10:12

  • JServer trigger problem.

    I am trying to provide push services over Oracle JServer via
    CORBA -- the push being triggered from a database trigger. It
    seems that instances in the server run in a VM private to the
    client session. Although Stored Java Procedures are able to
    access static methods of the class being run; I have been unable
    to get the Stored Java Procedure -- executed via a trigger, to
    perform a call back via the class instances running under the
    JServer / Session.
    This seems a natural use of Java Stored Procedures and Serverside
    processing --
    Is there anyone who has encountered and preferably solved this
    problem.
    null

    I am trying to provide push services over Oracle JServer via
    CORBA -- the push being triggered from a database trigger. It
    seems that instances in the server run in a VM private to the
    client session. Although Stored Java Procedures are able to
    access static methods of the class being run; I have been unable
    to get the Stored Java Procedure -- executed via a trigger, to
    perform a call back via the class instances running under the
    JServer / Session.
    This seems a natural use of Java Stored Procedures and Serverside
    processing --
    Is there anyone who has encountered and preferably solved this
    problem.
    null

  • Multiple Rows Update / Refresh Toplink Query when database trigger involved

    Hi everybody!
    I have two easy troubles for you; the platform is the same as the SRDemo Toplink version.
    1.     Multiple Rows Update: I want to update with mergeEntity method, multiple rows for an isolated table; that method receives a parameter that I try to bind with the iterator "dataProvider" but it only merges the first row, not all, any other combination returns an error.
    What I want to do is to have a form (like tabular forms in Apex) that lets me update multiple rows in a single page. ¿May anyone tell me how to do it?
    2.     Refresh Toplink Named Query: I have a list on a page with two columns. From another page, a button does an action that fires a database trigger that updates one of the columns on the list´s page. When I go back to the list, it is not updated; however, the CacheResults´s property is set to false on the iterator.
    Thanks in advance,
    Alejandro T

    I didn't use it (yet), but - you might take a look. You'll find a [url http://www.oracle.com/technetwork/developer-tools/apex/application-express/apex-plug-ins-182042.html]Timer plug-in on this page. It is a dynamic action which allows you to periodically fire other dynamic actions in the browser. For example use the timer to refresh a region every five minutes. You can perform any dynamic action you want using this infrastructure.So I was thinking: you might use it to run a dynamic action which would check whether something changed in that table (I suppose you'll know the way) (for example, a database trigger might set a flag in some table, timestamp or similar), and - if you find that something really changed - refresh the page.
    As I said, I never used it so that's pure theory. Someone else might know better, though.

Maybe you are looking for