What is the difference between these two triggers.

Hi guys,.

Can you please the difference between these two triggers:

A
CREATE OR REPLACE TRIGGER  "T_CLIENT_STATUS_LOOKUP" before insert or update on "CLIENT_STATUS_LOOKUP" for each row begin if inserting and :new."CLIENT_STATUS_ID" is null then 
  for c1 in (select "CLIENT_STATUS_LOOKUP_SEQ".nextval nv from dual) loop 
     :new."CLIENT_STATUS_ID" := c1.nv;   end loop; end if; end;
VS


B
CREATE OR REPLACE TRIGGER  "CLIENTS_TRG1" 
    BEFORE INSERT ON ERP.CLIENTS 
    FOR EACH ROW 
begin
                  if :new.CLIENT_ID is null then
                      select CLIENTS_seq.nextval into :new.CLIENT_ID from dual;
                 end if;
              end; 
I created manually trigger B. But to trigger A, on APEX, we have created by APEX lookup table. Then, I got a relaxing by APEX. but I did not understand the difference.

Kind regards
Fateh

My vote 2nd relaxation. Because in the first trigger you use ' before insert or update", but there is nothing so far...; Oracle must go in the PL/SQL engine for each update to the table without reason; There is nothing to update, you do not have to shoot. While in the 2nd you do something sensible; If client_id is null, it will go to search by sequence forward.

Concerning
Girish Sharma

Published by: Girish Sharma on June 9, 2012 13:06
Just paste your code into the code for easy reading tags:

CREATE OR REPLACE TRIGGER  "T_CLIENT_STATUS_LOOKUP"
before insert or update on "CLIENT_STATUS_LOOKUP"
for each row
begin
if inserting and :new."CLIENT_STATUS_ID" is null then
  for c1 in (select "CLIENT_STATUS_LOOKUP_SEQ".nextval nv from dual)
     loop
     :new."CLIENT_STATUS_ID" := c1.nv;
  end loop;
end if;
end;

CREATE OR REPLACE TRIGGER  "CLIENTS_TRG1"
BEFORE INSERT ON ERP.CLIENTS
FOR EACH ROW
begin
 if :new.CLIENT_ID is null then
   select CLIENTS_seq.nextval into :new.CLIENT_ID from dual;
 end if;
end;

Tags: Database

Similar Questions

  • What is the difference between these two JKM and when to use that one.

    Please tell the difference between these two.
    JKM Oracle compatible o JKM Oracle compatible (Date of update)

    Basic difference is in the obligation.

    JKM Oracle compatible (Date of update) wants a DATE/TIMESTAMP column in the source tables (s) who will get inserted/updated updated by the source application. ODI will capture the data modified, based on the value of this column. Only the DELETION part requires a trigger to keep track of deletion happening at source one or more tables.

    Where as JKM uniform Oracle does not require any which TIMESTAMP column in the tables of the source (s). It uses triggers to keep track of the INSERT/UPDATE/DELETE happening in the source.

    Compatible JKM Oracle performance (Update Date) is preferable, because it will create a little over the head on your source system. SO if you have a DATE/TIMESTAMP column in the tables of the source (s) that gets inserted/updated by the source application, then go JKM Oracle compatible (Date of update).

    Otherwise search JKM consistent Oracle.

    Thank you
    Fati

  • What is the difference between these two series: ONE VIDEO and a VIDEO SN184?

    Hello

    Is anyone know the difference between these two serial numbers: A VIDEO and a VIDEO SN184?

    Hi Lennart,

    This might be useful: ONE VIDEO AND ONE NON-VIDEO

    Kind regards

    Sheena

  • What is the difference between these two WGA updates?

    When I went to the windows update site (after a fresh install of Win XP) there is a update called:
    Windows Genuine Advantage Validation Tool (KB892130)

    and when I installed the update, the next page listed high priority updates, one of them is the following:
    Windows Genuine Advantage Notification (KB905474)
    Size: 1.5 MB
    Description: The Windows Genuine Advantage Notification tool tells you if your copy of Windows is not genuine. If your system is found to be non-genuine, the tool will help you get a copy of Windows.

    While the second update above description, the first doesn't work, then what is one and how they differ from each other?

    Thank you

    Here's what it not different-online

    KB892130 and KB905474 are both optional, updates not safety.

    The two were offered and installed via Windows Update/Automatic Updates.

  • What is the difference between these two types of defs?

    We give a point constraint, I checked and they are both the same representation (U16)

    It doesn't matter if they are the same representation. If they are different typedefs you will get the point.

  • What is the difference between these two downloads? What does the "N"?

    SW_DVD5_NTRL_Windows_Vista_64BIT_English_DLA_SP2

    SW_DVD5_NTRL_Windows_Vista_64BIT_English_DLA_N_SP2

    Editions N editions are without any Windows Media technology. EU forces MS to provide such an edition. "A programmer is just a tool that converts the caffeine in code" Deputy CLIP - http://www.winvistaside.de/

  • What is the difference between these commands

    Oracle 11.2.0.1
    Windows 7

    Please tell me what are the differences between these two commands:

    RMAN/RMAN@ORCL catalog RMAN
    Catalog RMAN target scott/tiger RMAN/RMAN@ORCL

    Here the user scott is too have DBA role. Recovery catalog owner is rman. I wish to test backup and restore, as well as the above command must be used.

    To develop.

    Thank you.

    user12050217 wrote:
    Oracle 11.2.0.1
    Windows 7

    Please tell me what are the differences between these two commands:

    RMAN/RMAN@ORCL catalog RMAN

    This is happening to you the recovery catalog database but not connect to the target database. So you must issue a further statement while connected to RMAN to connect to the target database. Here the user RMAN is the catalog name of the owner.

    Catalog RMAN target scott/tiger RMAN/RMAN@ORCL

    You try to connect to the database target db user RMAN catalog as user Scott.

    Here the user scott is too have DBA role. Recovery catalog owner is rman. I wish to test backup and restore, as well as the above command must be used.

    The backup will be done using the Sysdba role, not with the DBA role. So you must still issue the command to connect to the target db. In the 2nd order you establish this connection and in 1, you must take another step for him.

    To develop.

    Its developed already in the backup and restore reference guide. Read it,
    http://docs.Oracle.com/CD/E11882_01/backup.112/e10642/TOC.htm

    Aman...

  • What is the difference between these privileges...

    What is the difference between these two privileges?

    CREATING INDEXES
    CREATE AN INDEX

    I tried to look through the Oracle online documentation and do some research on Google, but I can't seem to get a good search criteria to get meaningful results :(

    Darren

    Like doc Oracle mentioned, there is no separate CREATE INDEX privileges. It goes with CREATE TABLE.

    To create an index in the schema of another user, you must have the CREATE ANY INDEX system privilege.
    http://download.Oracle.com/docs/CD/B19306_01/AppDev.102/b14251/adfns_indexing.htm#sthref592

  • What is the difference between these columns?

    What is the difference between the following columns in the dynamic view V$ system_event?
    column: TOTAL_WAITS
    column: TIME_WAITED
    column: TIME_WAITED_MICRO

    They are the columns of the difference.

    TOTAL_WAITS: Total number of waiting for the event.
    TIME_WAITED: Total time waited for the event (in hundredths of a second)
    TIME_WAITED_MICRO: Total time waited for the event (in microseconds)

    Anyone can develop in more detail?

  • What is the difference between these Adobe Air SKD folder locations in flash Builder 4.7?

    So I can fall AIR SDK within the Adobe Flash built 4.7 (64-bit) / folder SDK (less 4.6.0) - according to the instructions in the tutorials of adobe.tv Starling, or, according to the docs, Adobe labs, put them in eclipse/plugins/com.adobe.flash.compiler_4.7.0.349722/AIRSDK

    Who is right? What is the difference? I do both to hedge my bets?

    Thanks in advance for not confusing me!

    "SDK" is for the Flex SDK.

    "AIRSDK" contains the SDK included with FB 4.7 3.4 AIR.

  • What is the difference between these Update menu items?

    Hello

    I have these items to update two showing in my menu bar:

    Adobe-Updater.pngCloud-Updater.png

    Those with the Adobe logo comes to open the creative menu cloud when you click "open Updater... ». I wonder why both appear and whether the issue of the Adobe logo is supposed to update something non - CC.

    I did a new install of CC, so there should not be any inherited accession, preferences or items in library on my system.

    Thank you!

    Hi joerivera ,

    Please see the Ko: http://helpx.adobe.com/creative-cloud/kb/redundant-update-notifications.html .

    Kind regards

    Romit Sinha

  • What is the difference between an icon of hard drive on my desktop and a home icon in the Finder?

    Hello

    I'm confused about the icon I have on my desk (hard drive) and a picture of a house in the Finder.  My iMac is divided between two discs?   What is the difference between these two, if any?

    the House is your account, which is located ON your hard disk, but it is NOT your hard drive.

  • What is the difference between the cookies keep until I close firefox and the history of cookie empty closing firefox?

    In the settings of Firefox 33.0 (I use Ubuntu 14.04, but the functionality is the same for Windows 7) there are two ways to delete cookies when firefox closes. Or at least, there seems to be.

    Is first the cookies keep until firefox is closed

    Second is to check the box for clear history of firefox closing and in the settings check cookies.

    What is the difference between these two options?

    I usually have two configuration but I noticed that a connection was not save for td canada trust EasyWeb, even though I have an exception set for it. Now I unchecked to remove cookies by disabling the history on close and connection records correctly.

    This connection allows to save 7 cookes under easyweb.td.com and 10 cookies under td.com and I have exceptions defined for both. If I clear the history when closing and include cookies, half of the td.com cookies disappeared when I close firefox and re - open. The same is true if I'm not the exception.

    So currently I can't find a way to keep all cookies if I clear the cookie history when firefox closes. What is the difference with this option?

    When you change the default cookie 'to life' of "keep until: they expire" to "keep until the: I close Firefox", Firefox changes all persistent cookies that sites set session cookies. To allow a site to place a persistent cookie, you need to make an exception (site permission).

    When you turn on the story to stop compensation and include cookies, running a completely separate process that doesn't doesn't pay attention to the duration of cookie or exceptions (permissions site). There just nukes all.

    Note that some cookies could survive if they are encoded in the history file of your session of compensation at the stop, a Firefox uses to restore your tabs and windows from last session. I have not tested.

  • Tecra A2 - what is the difference between the cooling modules Tecra A8?

    Hello

    I have Tecra A2 and my fan is almost 'dead '. So I think to buy a new one.

    And here my question:
    "What are the differences between Fans (P000401740) A2 and A8 (P000463770) for example?"

    Because despite the construction of the "rotor" as well as details of construction of the case they seem to be exactly the same.
    If I buy this A8, it would work with my laptop?

    Kind regards
    Christopher

    Hello

    I m not very well what s the difference between these two modules of cooling but the fact is that the motherboards are just different and I doubt that a cooling module that was not designed specifically for the Tecra A2 series would correspond with A2 motherboard and case.

    That's why I recommend buying a cooling module which has been designed especially for this series!
    I think you can order the Toshiba ASP.

    Good bye

  • What is the difference between abandonment and reset in Laview FPGA module

    Hello

    I used Abort in Labview FPGA e-mail trying to stop the running program in FlexRIO while I got an unexpected behavior.

    After replacing the demolition of the reset all goes well.

    What is the difference between these two functions?

    Thank you

    Fang

    Hello Fang,

    If this answers your questions, then please indicate that answers your question by clicking on "accept as a Solution.

    If that doesn't answer your questions, so please let me know.

Maybe you are looking for

  • How to load a profile registered from another HD than C:

    Had a total HD crash and am now rebuild all. My Thunderbird mail was recorded on a hard disc separate just in case something like this happened. I rebooted Thunderbird who created a new account. Now, I not want to use the same profile on the other ha

  • iPod will work with my Equium L20-197

    I have a problem with my wife, Equium L20-197 in XP, when you try to sync with an ipod shuffle (gen2). Will not mount on my computer, is not detected by itunes, but is present in Device Manager but the report he needs a driver to operate properly. I

  • only get a single photo on board contact despite the selection of several columns.

    When you select the photo and contact sheet then, there is only a single photo in the upper left column. Unable to get several copies despite the selection of several columns.

  • I wiped drive hard need driver for presario cq50 215nr vista 32-bit ethernet?

    I wiped drive hard need driver for presario cq50 215nr vista 32-bit ethernet? I had a virus somehow, so I wiped my hard drive using a wipedisc and now I don't have access to the internet on this laptop I need a link to download a driver for my ethern

  • read tip or parameter to force physics

    I'm using Oracle 11.2.0.3. I have a query that took 45 minutes the first time and it take 4 minutes to subsequent term in QC environment. In both cases he uses the same plan. If I try the query again in a few days, first time, it takes a lot of time.