Trigger Nestlevel in Oracle?

Hi friends. I use the variable @@nestlevel to control the execution level of a trigger in SQL. There are some way to do this test and control in Oracle? I have a trigger, but I want that your body be executed only if the nestlevel be > 1.

This is an example related:
Calling a Procedure in a Trigger Body: Example
You could create the salary_check trigger described in the preceding example by calling a procedure instead of providing the trigger body in a PL/SQL block. Assume you have defined a procedure hr.salary_check, which verifies that an employee's salary is in an appropriate range. Then you could create the trigger salary_check as follows:
CREATE TRIGGER hr.salary_check
BEFORE INSERT OR UPDATE OF salary, job_id ON hr.employees
FOR EACH ROW
WHEN (new.job_id <> 'AD_VP')
CALL check_sal(:new.job_id, :new.salary, :new.last_name);
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_76a.htm#2064411
Joel Pérez

Similar Messages

  • Global temp table trigger error on Oracle AS

    we have a set of triggers that load a temp table in the before delete,update and process the table in an after statement trigger. the data that's loaded is a complaintid and when the complaintid is selected into a variable in the after statement, a No data found error is fired. This only happens on Oracle AS both 9i and 10g, it does not happen on jboss. All the app servers use connection pooling and they are 9i Enterprise Edition Dedicated database servers.
    Is it possible that there is a bug in Oracle AS that allows multiple sessions to affect the same global variables ?
    Sorry it's a long one, but I wanted to include everything I could
    table creation script.
    CREATE GLOBAL TEMPORARY TABLE TEMPEVENTS
    (     COMPLAINTID VARCHAR2(20) NOT NULL ENABLE,
         COMPLAINTEVENTID NUMBER NOT NULL ENABLE,
         STARTDATE DATE,
         EVENTTYPE NUMBER,
         EVENTSUBTYPE NUMBER,
         DELETED NUMBER
    ) ON COMMIT DELETE ROWS
    Before update trigger-- as a test I saved the data in a permanent table and all columns have usable values.
    create or replace trigger BeforeUpdateReportDataROW
    BEFORE Delete or Update of deleted, startdate on complaintevents
    FOR EACH ROW
    BEGIN
    IF (DELETING AND :old.deleted = 0) OR (UPDATING AND :new.deleted=1 AND :old.startDate = :new.startDate) THEN
         TEMPDATA.v_triggerType := 'D';
    ELSIF UPDATING AND :old.deleted=1 AND :old.startDate = :new.startDate THEN /*undeleting*/
         TEMPDATA.v_triggerType := 'U';
    ELSIF UPDATING AND :old.startDate != :new.startDate THEN /*new date*/
         TEMPDATA.v_triggerType := 'S';
    ELSE
         TEMPDATA.v_triggerType := 'N';
    END IF;
    TEMPDATA.v_NumEntries := TEMPDATA.v_NumEntries + 1;
    TEMPDATA.v_complaintids(TEMPDATA.v_NumEntries) := :old.complaintid;
    TEMPDATA.v_complainteventids(TEMPDATA.v_NumEntries) := :old.complainteventid;
    END;
    After statement trigger -- the error happens on the
    SELECT complaintid
    INTO complaintid
    FROM complaintevents
    WHERE complaintid = tempdata.v_complaintids (loop_index)
    AND complainteventid = tempdata.v_complainteventids (loop_index);
    statement. this is all one transaction the complaintid is loaded from the complaintevent table, and is not a primary key, nor is there only one record in the complaintevent table for each complaintid.
    create or replace trigger complaintevents_del_upd_trig
    AFTER DELETE OR UPDATE OF deleted, startdate
    ON complaintevents
    DECLARE
    complaintid VARCHAR2 (20);
    loop_index NUMBER;
    hold_complaintid VARCHAR2 (20);
    BEGIN
    IF tempdata.v_triggertype = 'D'
    THEN /*deleting event*/
    hold_complaintid := ' ';
    FOR loop_index IN 1 .. tempdata.v_numentries
    LOOP
    SELECT complaintid
    INTO complaintid
    FROM complaintevents
    WHERE complaintid = tempdata.v_complaintids (loop_index)
    AND complainteventid = tempdata.v_complainteventids (loop_index);
    IF hold_complaintid != complaintid
    THEN
    INSERT INTO tempevents
    (complaintid, complainteventid, startdate, eventtype,
    eventsubtype, deleted)
    SELECT complaintid, complainteventid, startdate, eventtype,
    eventsubtype, deleted
    FROM complaintevents
    WHERE complaintid = tempdata.v_complaintids (loop_index);
    END IF;
    DELETE tempevents
    WHERE complainteventid =
    tempdata.v_complainteventids (loop_index)
    OR deleted = 1;
    hold_complaintid := complaintid;
    END LOOP;
    ELSIF tempdata.v_triggertype = 'U'
    THEN /*undeleting*/
    hold_complaintid := ' ';
    FOR loop_index IN 1 .. tempdata.v_numentries
    LOOP
    SELECT complaintid
    INTO complaintid
    FROM complaintevents
    WHERE complaintid = tempdata.v_complaintids (loop_index)
    AND complainteventid = tempdata.v_complainteventids (loop_index);
    IF hold_complaintid != complaintid
    THEN
    INSERT INTO tempevents
    (complaintid, complainteventid, startdate, eventtype,
    eventsubtype, deleted)
    SELECT complaintid, complainteventid, startdate, eventtype,
    eventsubtype, deleted
    FROM complaintevents
    WHERE complaintid = tempdata.v_complaintids (loop_index);
    END IF;
    DELETE tempevents
    WHERE deleted = 1;
    INSERT INTO tempevents
    (complaintid, complainteventid, startdate, eventtype,
    eventsubtype, deleted)
    SELECT complaintid, complainteventid, startdate, eventtype,
    eventsubtype, 0
    FROM complaintevents
    WHERE complainteventid =
    tempdata.v_complainteventids (loop_index);
    hold_complaintid := complaintid;
    END LOOP;
    ELSIF tempdata.v_triggertype = 'S'
    THEN /*date change*/
    hold_complaintid := ' ';
    FOR loop_index IN 1 .. tempdata.v_numentries
    LOOP
    SELECT complaintid
    INTO complaintid
    FROM complaintevents
    WHERE complaintid = tempdata.v_complaintids (loop_index)
    AND complainteventid = tempdata.v_complainteventids (loop_index);
    IF hold_complaintid != complaintid
    THEN
    INSERT INTO tempevents
    (complaintid, complainteventid, startdate, eventtype,
    eventsubtype, deleted)
    SELECT complaintid, complainteventid, startdate, eventtype,
    eventsubtype, deleted
    FROM complaintevents
    WHERE complaintid = tempdata.v_complaintids (loop_index);
    END IF;
    DELETE tempevents
    WHERE deleted = 1;
    hold_complaintid := complaintid;
    END LOOP;
    ELSE
    RETURN;
    END IF;
    END;

    CREATE GLOBAL TEMPORARY TABLE test_glb ON COMMIT DELETE ROWS
    AS SELECT * FROM test1;btw I'm assuming you are just using the SELECT statement to copy the definition of test1. Since DDL statements commit, there will be no rows in test_glb after creating it.
    Edited by: William Robertson on Feb 23, 2009 7:31 AM

  • Database trigger to Launch Oracle Procedure

    Hello All,
    I wrote a db trigger (on insert) to launch "apps.fnd_request.submit_request" which in turn launches a custom oracle procedure. Everything works fine, except the user says they cannot wait the 30 seconds to 1 minute for this concurrent request to kick off...
    Question: is there a better way to directly call this custom procedure from a DB trigger ? With the commit/rollback restrictions in the trigger, I am not sure how to get around this ?
    Any help would be appreciated.
    Thanks..

    I used the DBMS_SCHEDULER procedures with great success outside of a DB trigger. Problem is inside the DB trigger it is throwing an exception and does not give me an indication of what the problem is..
    When I run the following queries, I see no entries..
    ========================================
    SELECT to_char(log_date), job_name, additional_info
    FROM all_scheduler_job_run_details
    where job_name = 'LAUNCH_LNVDLVMAN'
    SELECT to_char(log_date), job_name, operation, status, additional_info
    FROM all_scheduler_job_log
    WHERE owner = 'APPS'
    =======================================
    The following code that is called is the same inside and outside of the "After Insert" trigger. I tried use_current_session as both True and False, and I tried to run as Execute Immediate with no luck.
    -- Run job synchronously.
    DBMS_SCHEDULER.run_job (job_name => 'LAUNCH_LNVDLVMAN',
    use_current_session => FALSE);
    Question: Does the DBMS_SCHEDULER work when called from within a DB trigger ? I have not seen anything on the web saying yeah or nay. Has anyone run into this before ?
    Thanks in advance

  • Required Trigger To be Oracle Application Forms Customization and its order

    Hi All,
    I am new to oracle application forms customization.
    Can you please answer following?
    What are the triggers required to be overrided for forms customization in oracle appliocation?
    What is the order of trigger event occurrs when forms comes up in Oracle application?
    Thanks
    Prashant

    Hi Prashant,
    There are a number of triggers in Oracle forms. They are basically 4 types
    1. Form level
    2. Block Level
    3. Record Level
    4. Item Level
    Again there are subclassifications.
    The firing sequence depends on your action. If you make a change in an item and save the item level triggers fire for the item you changed. Then the record level triggers fire. However if you are click in an item(you are technically navigating to the item) the record level(when new record instance-WNRI) fires and then the item level trigger(when-new-item-instance WNII) fires.
    So it depends on the situation. Look in the forms tool help sections. The have some good discussions there.
    Now to 'override' triggers. I am assuming you plan to extend oracle standard forms. The best way to do this is use the CUSTOM.pll. Oracle forms call this .pll in various triggers such as WNRI, WNII etc. You can add your logic here and it will take effect and will be upgrade safe. Nowadays they have forms personalization. Take a look at this also to determine the best way.
    You may want to read the Application developers guide from metalink and they have a good discussion there on forms customization. It also talks about the CUSTOM.pll
    The scope of forms is huge and you would be better of taking a
    1. Forms course
    2. quick look through the forms section of the developer's guide and understand the concepts
    3. Honing on the customizations you want to do and start working on that specific component.
    4. Look in Metalink which has a lot of info on forms and forms forums.
    This is actually a Framework forum which deals with Web applications :-)
    Thanks
    Sandeep

  • Oracle: Asynchronous trigger processing in Oracle

    could anyone explain how Oracle executes triggers,
    namely if a trigger is fired in asynchronous mode
    or not? Maybe it is tuneable?
    For example, there is a trigger defined as
    CREATE OR REPLACE TRIGGER Convert_Transaction
    AFTER INSERT OR UPDATE ON TB_TRANSACTIONS
    FOR EACH ROW
    BEGIN
    --code which may be time-consumimg
    END;
    This is the only trigger defined for the table.
    Will Oracle allow inserts in the table
    TB_TRANSACTIONS if the processing of trigger
    from the previous INSERT is not finished?
    If so, will the trigger for this new INSERT
    be fired?
    The behaviour i need is to allow inserts while
    processing the previous "after insert" trigger,
    but to block trigger execution if another trigger
    is still executing, i.e. to make a queue of triggers
    waiting their time to fire.
    Can Oracle provide such behaviour with triggers?
    Maybe i should look for another solution?
    Thanks for the help!

    Santosh_Oracle wrote:
    could anyone explain how Oracle executes triggers,
    namely if a trigger is fired in asynchronous mode
    or not? Maybe it is tuneable?
    For example, there is a trigger defined as
    CREATE OR REPLACE TRIGGER Convert_Transaction
    AFTER INSERT OR UPDATE ON TB_TRANSACTIONS
    FOR EACH ROW
    BEGIN
    --code which may be time-consumimg
    END;
    This is the only trigger defined for the table.
    Will Oracle allow inserts in the table
    TB_TRANSACTIONS if the processing of trigger
    from the previous INSERT is not finished?You wouldn't be able to insert into the same table in the same session so it's irrelevant. You'd have to wait for the first insert to finish first. And other sessions won't see any of those inserts until it is commited in that session first.
    The behaviour i need is to allow inserts while
    processing the previous "after insert" trigger,The first insert or it's firing trigger won't prevent other sessions from inserting too.
    but to block trigger execution if another trigger
    is still executing, i.e. to make a queue of triggers
    waiting their time to fire.They are seperate transactions and you'd have to try and implement some sort of autonomous transaction to do that, but then you could end up in some sort of deadlock situation. Is there a particular reason why you need to do this?
    Can Oracle provide such behaviour with triggers?
    Maybe i should look for another solution?That sounds like the best plan. ;)

  • "Before Form Trigger Failed" in Oracle Reports

    Hi,
    I have RDFs stored in the Oracle Reports Server (installed in Solaris Server1). These RDFs access a common package (in compiled status) which resides in Oracle DB (installed in another Solaris Server2).
    Everytime whenever there is a change in this common package I compile this and I verify the status to be in VALID status. After this I execute my RDF through a shell script and my report fails with the above error message.
    WITHOUT RECOMPILING, when I RE-EXECUTE the report, it works fine.
    Can anyone please help me to resolve this issue as it happens everytime in Production when I promote this package to Production DB, compile and execute a report.
    The execution of ANY report fails (immediately after compilation) and is NOT consistent with one particular report. What I mean is, any RDF executed after the compilation fails and succeeds when it is re-executed without any changes.
    All the file access paths are availables for reading, writing and executing the file.
    Thanks in advance!
    Regards,
    Teenu

    After you re-compile your packages,
    Open up the affected .RDF's in Report Builder
    Choose 'Save As' from File toolbar
    Overwrite the existing file in the $reports directory on the server.
    For some reason Reports gets "out of sync" so to speak with packages and even local PL/SQL triggers/functions/procs... This is why sometimes even after you compile your local functions and triggers you still get the "Report contains uncompiled PL/SQL" error. Try the suggestion and let me know if it resolves your issue.
    HTH,
    Steve

  • Preventing trigger executing on oracle lite

    I am using Mobile Server and Oracle Lite to provide mobile copies of the database to a small set of users. We have an application that some users use to update data on the mobile databases, and the same application is used by other users who are permanently connected to the main central database. Mobile users will synchronize with the central database whenever they return to their home office.
    On both they central Oracle database and the Oracle Lite mobile databases there are several triggers written for functions such as creating unique primary keys from sequences and updating a "last updated" field on each table (plus a few more complicated scenarios).
    My problem is that I want these triggers to execute only on inserts, updates and deletes from actions initiated directly on the mobile workstation. I do NOT want these same triggers to be executed on either the central or mobile databases as a result of a synchronization with the central Oracle database.
    How do I prevent triggers from executing on the oracle lite mobile database as a result of table data changes from a synchronization with the central database?
    Edited by: user10300540 on Dec 22, 2009 3:58 PM

    We do use sequences to populate primary key ID values, but do not use triggers to set these (even on the server applications) due to the problems associated with foriegn key matching. Instead the sequences tend to be selected within the application and then used explicitly in the insert statements.
    On the clients (PDAs and laptops in outr case) we define sequences within the mobile publications (to ensure that the values are unique to each client - you do not mention how you create the client sequences, but you need to ensure that the range is different for each client otherwise you will get data overwritten), and then all insert statements are in the form insert into table (id,...) values (id_seq.nextval,..). I can see however that this would require more change to you application code to achieve this.
    It is possible to set triggers on the server end to populate/change the id values, but this can cause problems if the data is returned to the client as you will end up with two records.
    Our client app is java based and so sets up a SQL string that is executed by the execute statement methods. This could be wrapped with a method that sets the id values, but this could be a bit cumbersome
    NOTE When we define the sequences in the mobile applications we always set a start point considerably higher than the equivilent range on the server (start at 500 million) with a large range so that in practice they do not need to be reset. The range difference is also useful in that it makes it easy to identify client created data.

  • How to synchronize Sql Server when Oracle table has trigger

    Hi
    I have a trigger which will update/insert the data into a Oracle table.
    I have an interface which normally moves the data from Oracle table to SQL Server table.
    Is there any way which will update/insert the data into SQL Server table whenever any trigger fires on Oracle table.
    Thanks,
    Ganesh

    ODI's CDC capabilities can be used to propogate changes from Oracle to SQL Server. If your trigger inserts/updates on an oracle table, then ODI's CDC should pick that up. If you have a scenario which does a WaitForLogData on your Oracle table, it can kick off the interface to transfer the journal data whenever that happens.

  • BPM design for trigger based file from Oracle

    Hi
    We have one requirement as follows:
    1. We need to receive trigger file from Oracle.
    2. As soon as we recieved trigger file, it needs to activate all other 10 JDBC adapter channels.
    3. once reciever all 10 RFC channels completed, it needs to pass that trigger file.
    Please suggest design.
    Thanks
    Siva

    Hi Siva,
    1. We need to receive trigger file from Oracle.
    define a sender CC (FILE) which polls a directory every N seconds.
    The receiver of this message should be your BPM.
    2. As soon as we recieved trigger file, it needs to activate all other 10 JDBC adapter channels.
    in your BPM, trigger your 10 sender CC (JDBC). See sap help and blog to know how to trigger externally a CC. Easy to do.
    3. once reciever all 10 RFC channels completed, it needs to pass that trigger file.
    Then always in your BPM, you have to do a correlation on the 10 SQL responses (that's crazy!). Several blogs and threads on this subject.
    And after that, in BPM what do you do of these 10 SQL responses (thats' crazy!) ? do you have to merge data ?
    Welcome to the birthday of a future monster... for dev and maintenance... Sincerely simplify your flow!
    Question: do you really need to have 10 SQL? for your needs, is it not possible to create a stored procedure in database which will do the 10 SQL (with Join tables)... if yes do it, by tis way you will have only one Sender CC (JDBC) to trigger, and no correlation in a BPM. That will greatly simplify your flow.
    Regards
    Mickael

  • Trigger to populate table in sql server database

    Maybe this isn't the right board to post this in, but here goes:
    We have an Oracle 9i database, with a table that get's populated with a new record every minute or so.
    We need to take some values from the newly inserted record and populate a table in a sql server database instantly. The people requesting this have not said as much, but I am thinking deletes and updates would need to be the same.
    How would it be best to do this? My first thought was a trigger on the oracle table that populates the sql server table via heterogeneous db link.
    Any other ideas?
    thanks in advance..
    update- repost in heterogeneous forum
    Edited by: user571263 on Mar 15, 2011 11:25 AM

    Maybe this isn't the right board to post this inI think you are right:
    Heterogeneous Connectivity
    Werner

  • Firing sequence of Oracle forms 6.0 triggers

    Hi All,
    Pls tell anyone what is the sequence of trigger firing in oracle 6.0 (oracle apps).
    Thanks in advance

    Hi,
    Please see if these links/docs help.
    Note: 61675.1 - Trigger Execution Sequence in Oracle Forms
    firing sequence of triggers in oracle forms
    http://tinyurl.com/2wyffj6
    Thanks,
    Hussein

  • Convert php script to oracle procedure

    To all please help me... I wanna convert php script to oracle procedure..and the script is (exp)..
    <?php
    include("../config/koneksi.php");
    $customer=$_POST['customer'];
    $tanggal1=$_POST['theDate1'];
    $tanggal2=$_POST['theDate2'];
    $no_bulan=substr($tanggal1,0,2);
    $bulan_sajah= (substr($no_bulan,0,1)=='0')? substr($no_bulan,1,1) : $no_bulan;          
    $tahun_sajah=substr($tanggal1,3,4);
    $blnkmrn=(int)$bulan_sajah;
    $thnkmrn=(int)$tahun_sajah;
    if ($blnkmrn==1) {
         $bulan_lalu=12;
         $tahun_lalu=$thnkmrn-1;}
    else {
         $bulan_lalu=$blnkmrn-1;
         $tahun_lalu=$thnkmrn;
    $bulanlalu=strval($bulan_lalu);
    $tahunlalu=strval($tahun_lalu);
    $sql = "select nip_nas from edo_customer_master_dives where standard_name='$customer'";
         $stm = ociparse($conn,$sql);
         ociexecute($stm);
         ocifetch($stm);
         $data=ociresult($stm,1);
         $sql12 = "select PRODUCT_LINE_ID,sum(REVENUE)
    from PA_FACT_REV_BILLED_CC
    where nip_nas='$data' and year_id='$tahun_sajah' and month_id='$bulan_sajah' group by PRODUCT_LINE_ID";
         $stm12 = ociparse($conn,$sql12);
         ociexecute($stm12);
         $total_revenue=0;
         $i="0";
    while (ocifetch($stm12)){
         $rev_items=ociresult($stm12,1);
         $revenue=ociresult($stm12,2);
         $sql2 = "select * from PA_FACT_REV_BILLED_CC
    where nip_nas='$data' and PRODUCT_LINE_ID='$rev_items'";
         $stm2 = ociparse($conn,$sql2);
         ociexecute($stm2);
         ocifetch($stm2);
    $tahun=ociresult($stm2,1);
    $bulan=ociresult($stm2,2);
    $nipnas=ociresult($stm2,3);
    $prod_line=ociresult($stm2,4);
    $rev_item=ociresult($stm2,5);
    //$revenue=ociresult($stm2,6);
    $query1 = "select standard_name from edo_customer_master_dives where nip_nas='$nipnas'";
         $st1 = ociparse($conn,$query1);
         ociexecute($st1);
         ocifetch($st1);
         $nama_cust=ociresult($st1,1);
         $query2 = "select prod_line_lname from parameter.p_prod_line@dwhnas where prod_line_id='$prod_line'";
         $st2 = ociparse($conn,$query2);
         ociexecute($st2);
         ocifetch($st2);
         $nama_prod_line=ociresult($st2,1);
         $query3 = "select REV_TYPE_LNAME from parameter.p_rev_type@dwhnas where REV_TYPE_ID='$rev_item'";
         $st3 = ociparse($conn,$query3);
         ociexecute($st3);
         ocifetch($st3);
         $nama_rev_item=ociresult($st3,1);
         $query4="select sum(total_usage) from PA_FACT_TRAFFIC_CC where PRODUCT_LINE_ID='$prod_line' and nip_nas='$nipnas' and year_id='$tahun_sajah' and month_id='$bulan_sajah' group by PRODUCT_LINE_ID";
         $st4 = ociparse($conn,$query4);
         ociexecute($st4);
         ocifetch($st4);
         $total_usage=ociresult($st4,1);
         $total=$revenue + $total_usage;
         echo $tahun." ".$bulan." ".$nama_cust." ".$nama_prod_line." ".$nama_rev_item." ".$revenue." ".$total_usage." ".$total."<br>";
         $total_revenue=$total_revenue+$total;
    $i++;
    echo $total_revenue;
    //cost of product
    $query5="select * from PA_FACT_TRAFFIC_CC where nip_nas='$nipnas' and year_id='$tahunlalu' and month_id='$bulanlalu'";
    $st5 = ociparse($conn,$query5);
         ociexecute($st5);
         $total1=0;
         $total2=0;
         $total3=0;
         $total4=0;
         $total5=0;
    while (ocifetch($st5)){
         $nipnas=ociresult($st5,3);
         $lineid=ociresult($st5,4);
         $itemid=ociresult($st5,5);
         $call=ociresult($st5,6);
         $unit=ociresult($st5,7);
         $query6 = "select prod_line_lname from parameter.p_prod_line@dwhnas where prod_line_id='$lineid'";
         $st6 = ociparse($conn,$query6);
         ociexecute($st6);
         ocifetch($st6);
         $nama_prod_line=ociresult($st6,1);
         $query7 = "select REV_item_LNAME from parameter.p_rev_item@dwhnas where REV_item_ID='$itemid'";
         $st7 = ociparse($conn,$query7);
         ociexecute($st7);
         ocifetch($st7);
         $nama_rev_item=ociresult($st7,1);
    $query8 = "select * from cost_of_product where prod_line_lname='$nama_prod_line' and REV_item_LNAME='$nama_rev_item' and end_date is null";
         $st8 = ociparse($conn,$query8);
         ociexecute($st8);
         ocifetch($st8);
         $lineid_cost=ociresult($st8,1);
         $itemid_cost=ociresult($st8,2);
         $satuan=ociresult($st8,5);
         $nilai=ociresult($st8,7);
         if (strtoupper($satuan)=='MENIT') $total1=$total1+(($unit/60)*$nilai);
         if (strtoupper($satuan)=='KBPS') $total2=$total2+($unit*$nilai);
         if (strtoupper($satuan)=='SMS') $total3=$total3+($call*$nilai);
         if (strtoupper($satuan)=='SSL') $total4=$total4+($call*$nilai);
         if (strtoupper($satuan)=='SST') $total5=$total5+($call*$nilai);
    $total_cost_pots=$total1+$total2+$total3+$total4+$total5;
    echo $total_cost_pots;
    ?>
    this script just for exp.

    Please convert step by step. for example
    (1) remove inverted quotation mark ( ` )
    (2) modify constraints syntax (PRIMARY KEY,UNIQUE KEY, KEY etc.) to [url http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14200/clauses002.htm#g1053592]Oracle constraints.
    (3) modify some datatype to [url http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14200/sql_elements001.htm#i45441]Oracle datatype
    (4) think how to convert auto_increment ([url http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_6015.htm#i2067093]Sequence, [url http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_7004.htm#i2235611]Beffore Trigger etc. on Oracle)
    http://download-west.oracle.com/docs/cd/B19306_01/appdev.102/b14251/adfns_packages.htm#sthref864
    http://download-west.oracle.com/docs/cd/B19306_01/appdev.102/b14261/toc.htm

  • Entity bean with primary key generated by trigger

    Hi,
    We have a table(oracle) with one column as primary key,
    but the primary key is generated by trigger every time
    a new row is inserted into this table, inside the trigger,
    it uses oracle sequence to get the next val.
    If we want to use entity bean with it, what should we specify, it's not application-managed primay key, it's
    not auto-generated primary key either. How can we resolve
    it without change the database part.
    Any thought is appreciated.
    Thanks
    afang

    The code is already there with JDBC call inserting
    into the table, the inserting trigger then will generate
    sequence key and being inserted into primary key column.
    Now wondering if it's possible to change the code to use entity bean but without modifying the trigger (since it contains other business logics).

  • Text_IO in Oracle Reports 6.0 ?

    Hi all !
    I've build a Report with Report Builder 6.0.
    Now i want to write every row i get, in a file.
    So i want to use Text_IO. The Question is, how can i use a global (User) Variable with type "Text_IO.File_Type". I can only create a user variable with type "char, date, number".
    At the begin of Report i want to use the trigger "After parameter form" to open the file.
    Then i want to use a function where every row will be written to the file.
    At the end i want to close the file in trigger "after report"
    Perhaps someone can help me ?
    (Hope i had explained it easy, my english is not the best).
    Thank you.

    hello,
    you will have to create a package specifications that has the definition of this variable in it.
    you can than access the var using <packagename>.<varname> (e.g. myGlobals.myFile) from all PLSQL within your report (e.g. the after parameterform trigger).
    regards,
    the oracle reports team --pw                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Migrating Sybase "timestamp" data type to Oracle DB

    Hi,
    We are migrating huge Application currently running on Sybase database
    to Oracle 10.2.0.3 (500+ Tables and Stored Procedures).
    Have following questions regarding this Migration.
    1) Many of the Sybase Tables have column which is of Sybase data type "timestamp".
    Do you have any recommendation what is the data type to be used in Oracle for
    migrating "timestamp" data type in Sybase?
    2) How should we migrate existing data and business logic residing in Sybase for
    data columns of Sybase data type "timestamp" ?
    Given below are details on how we use Sybase timestamp Column in our Application
    and we are trying to arrive at the best Solution that is possible for migrating
    all those Tables and related business logic to Oracle.
    We have following Control Table in Sybase which has column of timestamp data type and
    some other Business keys.
    sp_help EQP_IES_CRE_TIMESTAMP (This is similar to desc <table> command in Oracle)
    EQP_IES_CRE_TIMESTAMP,dbo,user table
    default,Nov 14 2001 10:39AM
    CRE_TIMESTAMP ,timestamp,8,,,0,,,,0
    REF_NUM ,char,30,,,0,,,,0
    REC_UPD_DT ,datetime,8,,,1,,,,0
    EQP_IES_CRE_TIMESTAMPI1,clustered, unique located on default, CRE_TIMESTAMP, REF_NUM, REC_UPD_DT,0,0,0,
    Following is the overall logic used in Sybase
    -- Step 1: Based on Event, populate Control Table with new Row.
    -- CRE_TIMESTAMP timestamp Column gets auto-populated by Sybase
    insert EQP_IES_CRE_TIMESTAMP (REF_NUM, REC_UPD_DT)
    values (@uuid_ref_num, @event_cre_dt)
    Since CRE_TIMESTAMP is auto-populated, it does not appear in above INSERT statement.
    -- Step 2: Store timestamp value populated by Sybase in previous step,
    -- to variable @event_timestamp. This value would be referenced
    -- later in other SQL statements
    select @event_timestamp = CRE_TIMESTAMP
    from EQP_IES_CRE_TIMESTAMP
    where REF_NUM = @uuid_ref_num
    and REC_UPD_DT = @event_cre_dt
    -- Sample value for @event_timestamp could be '001c0000182f2089'
    -- It is not very readable or understandable
    -- Step 3: Delete Control Table entry made in Step 1
    delete EQP_IES_CRE_TIMESTAMP from EQP_IES_CRE_TIMESTAMP
    where CRE_TIMESTAMP = @event_timestamp
    -- Step 4: Make use of saved timestamp value from Step 2 to trigger queries
    -- against other Tables that have timestamp Columns
    -- Some sample queries are as shown below
    delete eqp_staging
    where event_timestamp > @event_timestamp;
    insert into eqp_movement values(@event_timestamp, ......other columns) ;
    Any idea how above Table and logic could be migrated to Oracle DB
    We would also like to know how data values that currently exist
    in Sybase Tables should be populated in Oracle .
    Any suggestions or tips would be greatly appreciated
    Thanks
    Auroprem

    Hi All,
    Thanks for your responses.
    We have decided on Solution to migrate "timestamp" Column from Sybase to Oracle, that is
    specific to our Application needs.
    Following is what we decided:
    1) Create RAW Column in Oracle which would contain data Replicated from Sybase "timestamp" Column as is.
    2) Create additional Column of INTEGER data type to store number equivalent of Sybase "timestamp" column
    which would be more usable and consummable in Oracle as compared to RAW datatype.
    3) Write Row-Level INSERT/UPDATE Trigger on migrated Oracle Table to populate INTEGER Column using
    SQL Function TO_NUMBER(<raw_column_value>, 'xxxxxxxx').
    4) Applications that access this Table, upon migration to Oracle, will now start referencing INTEGER Column
    newly defined, and populated via Trigger.
    Please let us know if you see any issues with this approach
    Thanks
    user641521

Maybe you are looking for

  • Legacy project vs new browsers

    Hi all, I have one client project for whom we still use TCS1, for updates about twice a year. This is the only client we use it for, so we have never upgraded. We do have a copy of RH10 standalone, but otherwise we have been increasingly using Flare

  • SD contract "Orders quantity"

    Hi! Is there any FM to get for contract position sum of all reference orders positions sales quantity ? Definitely speaking I have to get value and unit of measure as how it looks in transaction VA43 for contract item in "Orders quantity" column on i

  • Business partner with GUID does not exist

    We're trying to replicate a customer from R/3 to CRM. We keep getting this error. It appears it';s trying to update the partner and since it doesnt exist in CRM, this message pops up. We're using R3AR2-4 to define and start the request to pull the da

  • MultiCamera Editing-Color Correction

    I have done a shoot with two cameras. Loaded the two tapes into FCP and ready for MultiCamera editing. What if I would like to color correct the two clips to have them look similar, before I do the MultiCam edit. After the edit the clips are individu

  • Transporting Premiere CC keyboard shortcuts to Premiere CS6?

    Hi there, So I've found my Premiere CC .KYS file with all my custom keyboard shortcuts in. I'm going to be visiting another editor tomorrow and would like to be able to import my keyboard layout into their machine, but I'm not sure what version of Pr