Can I use "else if" in a trigger ?

My trigger works when I take out the "else if" part. Is there a way I can use something like the "else if" without getting compilation errors ? Either "nsn" or "load_date" is updated in the table ~ never both columns updated at the same time...
create or replace trigger upd_cib01_resolv_join_trg
after update on gateway.rpf_cib_resolved_join
for each row
when (old.scale_code = 'I4')
begin
if (:old.nsn != :new.nsn) then
update rpf_cib01_resolved_join
set nsn = :new.nsn
where cd_name = :old.cd_name and
zone_cell = :old.zone_cell and
frame_name = :old.frame_name;
else if (:old.load_date != :new.load_date) then
update rpf_cib01_resolved_join
set load_date = :new.load_date
where cd_name = :old.cd_name and
zone_cell = :old.zone_cell and
frame_name = :old.frame_name;
end if;
end;
thanks,
Vicki

The syntax is:
IF ...
ELSIF...
ELSE
END IF
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/controlstructures.htm#sthref894
So:
if (:old.nsn != :new.nsn) then
update rpf_cib01_resolved_join
set nsn = :new.nsn
where cd_name = :old.cd_name and
zone_cell = :old.zone_cell and
frame_name = :old.frame_name;
elsif (:old.load_date != :new.load_date) then
update rpf_cib01_resolved_join
set load_date = :new.load_date
where cd_name = :old.cd_name and
zone_cell = :old.zone_cell and
frame_name = :old.frame_name;
end if;
...HTH
Thomas

Similar Messages

  • New to LABVIEW. How can I use one analog channel to trigger acquisiton of a signal on another analog channel?

    I am new to using Labview and have been tasked to write data acqusition program for my company. We are attempting to log 6 machines, each with their own asynchronous trigger (I can't use one trigger for all 6 machines). I have the idea to use (for example) ai0 for the measurement and ai1 for the trigger (for one machine), yet I see nothing in the documentation on how this is done. I have tried playing around with the DAQ express VI (I am using Labview7) but still don't see a way to have the setup I am looking for. I'm sure this is a relatively easy question, but I'm unsure where to go to look for an answer. Any helpful pointers or guidance in the right direction
    would be very helpful!

    If what you want to do is start the acquisition of channel 0 when channel 1 reaches the trigger condition and not start channel 2 until channel 3 reaches it's trigger condition, then no, you cna't do that unless you have multiple daq devices. What can be easily done is continuously acquire all channels and monitor your trigger channels. When the trigger condition is met, then perform the analysis/logging. On the Analyze>Waveform Monitoring palette is the Basic Level Trigger Detection function. Use one for each trigger channel and have it return either the index or relative time of the trigger occurance. This value can then be used to idex that portion of the measurement channel that you're interested in.

  • Can I use the audio input to trigger a hot key or apple script?

    Hello All,
    I am looking for a solution to use a FireWire audio interface to record in multiple tracks in garage band. I am looking to have each track queue up a hot key or a apple script when that track is receiving audio and when the audio stops. for instance if person one is speaking the hot key is activated and stops when they are done talking. And when person 2 starts on a different channel a separate hot key is activated. Is there any way to do this?
    Thanks

    I realize you are asking specifically about 'defaults', but as they concede in 'man defaults', it may not be the best tool for editing properties in "complex" structures, such as those buried in dicts within arrays, etc.
    As an alternative, it looks like in 10.5, '/usr/libexec/PlistBuddy' is now a part of the standard install - 'PlistBuddy' may be more useful for this sort of task.
    For example:<pre>
    /usr/libexec/PlistBuddy -c "set Test:0:Name zzzz" /path/to/file.plist</pre>

  • What else can be used

    Hi all,
    am having problem to iterate to next record when using when validate record trigger.
    what else can be used instead of next_record to iterate through?
    thanks.

    following is the problem where i have to calculate backlog by comparing it with the value presented in the database and that of the changed by user.
    for exmaple in ven_share table share_quota defined was 100% and user changes it to 40 backlog should contain 60
    upto this my logic is working fine but when i iterate to next record i want backlog to show previous + newly changed value..
    can you suggest now how can it work in any other way??
    declare
         v_share number(3);
         bck number(4);
    --     total_bck number(3);
    cursor c1 is select share_quota from ven_share where vendor_code=:ven_share.vendor_code;
    begin
              first_record;
    --open c1;
    --fetch c1 into v_share;
    for i in c1
    loop
         v_share:=i.share_quota;
         if v_share<>:ven_share.share_quota--,:system.cursor_record
              then
              if v_share>:ven_share.share_quota
                   then
                   :ven_share.backlog:=v_share-:ven_share.share_quota;
                   bck:=:ven_share.backlog;
                   --next_record;
    --     total_bck:=bck+v_share-:ven_share.share_quota;
              end if;
         end if;
    --          if :ven_share.vendor_code is null
    --               then
    --                    null;
                        --bck:=:ven_share.backlog;
              --     else
              --     if v_share>:ven_share.share_quota then
                                       --     message(v_share);
         --     message(:ven_share.share_quota);
              --          :ven_share.backlog:=bck+v_share-:ven_share.share_quota;
         --     end if;     
    --          end if;
         --     end if;
    --     end if;
    EXIT WHEN :SYSTEM.LAST_RECORD ='TRUE';
    --NEXT_RECORD;     
    end loop;
    end;
    thanks

  • Can we use if/else condtions like

    can we use if [condtion1]
    then [condition2]
    elseif [condtion3]
    then [conditon4]
    in oracle.

    Nested Case could help you:
    Select *
    from
           <table_name>
    where
          <col1> =
          (case when <condition_1> then
                                   (case when <condition_2> then <result_2>
                                         when <condition_3> then <result_3> end)
           else <some_other_result> end);

  • How can I use the pulse train from a 6602 to trigger an niFGEN and niSCOPE on each rising edge of the pulse train?

    Hello,
    Here is my application: I need to use a 6602 counter/timer to generate a pulse train of certain frequency and duty cycle. On each rising edge of this pulse train, I need to output an arbitrary waveform on Ch. 0 of an niFGEN (5422) AND acquire data from CH. 0 of an niSCOPE (5124). I also need to synchronize the niFGEN and the niSCOPE to the same clock used for the pulse train (6602/ctr0). This process needs to continue until the user stops the system.
    I can generate the pulse train using the 6602 just fine using ctr0, but the pulse train shows up on OUT0 by default. When setting up the niFGEN and niSCOPE to trigger on rising/positive slope edge, OUT0 is not an option for either device as a source for the digital rising edge (pulse train). The main options for both are PFI0-3 and RTSI lines.
    Questions:
    1.) Is there a way that I can direct the pulse train to a location (such as an RTSI line) where BOTH the niFGEN and the niSCOPE can use it as a start trigger for each rising edge? I noticed in MAX that a route can be made between ctr0's internal output and a trigger line and others. If this is a solution, could you please explain how to accomplish this?
    2.) Once I configure the niFGEN and niSCOPE to be triggered on a digital rising edge, how can I effectively have this happen for every rising edge from the pulse train? In other words, can I just initiate the FGEN outside of the while loop and it will generate a waveform for each rising edge it sees at the source until the while loop is exitted?
    3.) Is setting a reference clock for the niFGEN and the niSCOPE the same thing as synchronizing both devices using the same clock that generated the pulse train? It is not clear to me the difference, and why it would necessarily be useful.
    Images of my current front panel and block diagram are attached. If you would rather have the actual VI's just let me know. Any help and/or explanation on this is greatly appreciated. Thanks in advance.
    Attachments:
    Front_Panel_Control.jpg ‏278 KB
    Block_Diagram_Control.jpg ‏263 KB

    Hello Cgifford,
    Welcome to National Instruments Forums.
    To output your signal to the PFI lines,
    you can use external connectios between OUT0 and PFI lines. You can also use
    the backplane to do so by routing into the same RTSI line.
    1)
    On the SCOPE and FGEN, the name of the
    terminals are actually “PXI Trigger Line x/RTSIx” but on the 6602 you might
    need to route the signal using the property:
    You can also use the DAQmx route signal which perform the same opperation.
    2)
    This will depend on the frequency of
    your pulse train. If this is lower than about 10 ms, then you can probably
    place this on a loop and start and stop the acquisition every time. If the
    frequency is higher than this, you will have to use:
    -       Scripting on the FGEN side (read more)
    -       MultiRecord Fetch (more information in the scope help file
    section “Acquisition Functions Reading versus Fetching”).
    3)
    The short answer is yes. The longer one
    might depend on how tight you need the synchronization to be (us, ns, ps). For
    very tight synchronization, you should look into here.
    Message Edited by Yardov on 06-18-2007 03:14 PM
    Gerardo O.
    RF Systems Engineering
    National Instruments
    Attachments:
    property.JPG ‏7 KB

  • How can I use the hardware compare feature of the 6551 card to trigger scripts

    I can dynamically and seamlessly generate different waveforms by triggering different scriptTriggers that drive one or more of the 4 PFI lines. However, I need to evaluate a channel at a specific location or locations set by a script marker in real-time and generate a different waveform stored in on-board memory based on the result of the evaluation. I have attempted to use the hardware compare feature without any success. I am trying to dynamically respond to an I2C device based on the ACKs or NACK response of the device under test. Can the 6551 card accomplish this? Has anyone successfully tested an I2C or SMBus communication stream with 6551 card?

    Hello,
    I can understand why hardware compare did not work out for you application.  Hardware compare uses a signal that was generated to make a digital pattern and then waits a few clock cycles before acquiring the signal that needs to be compared to the digital pattern. 
    I would look into using a script trigger to evaluate the channel value, where the script structure controls when it is evaluated.  Please note that script triggers will need to be cleared after they are detected for reasserting.  Some script syntax actually clear the script trigger and then use a wait until script trigger structure.  Please refer to the HS DIO Help for documentation on Common Scripting Use Cases. 
    Please provide us with further details about your application.  The more information, the better!  I was not too clear on what you where wanting to evaluate and where is it coming from. 
    I would also like to mention that National Instruments has a NI USB 8451 which is capable of I2C communication.
    NI USB 8451
    Samantha
    National Instruments
    Applications Engineer

  • I need to update my phone, but my computer broke, and do not have a new one. I have an Itunes account, can I use someone else computer to go through with the update?  Is there a chance of loosing all my data, ie: music/photos?

    I need to update my phone, but my computer broke, and do not have a new one. can I use someone else computer to go through with the update if i log on with my itunes account or Is there a chance of loosing all my data, ie: music/photos? And if all else fails can i go to the apple store and have them update my phone?

    Update to what? The 3G you want to update? You have ios3 or 4 on that 3G?
    Go to a friend, authorize that pc.
    Read this : http://support.apple.com/kb/ht1848
    and this : http://support.apple.com/kb/ht2519
    Make a backup of your stuff (from the phone. apps/photos/music/blabla). Update your phone. The phone will restore the backup automatically.

  • How can I use an IF ELSE statement and the xdoxslt: get_variable together?

    First of all, I'm a big fan of this forum and I just want to thank the community for helping make the BI Publisher world a better place.
    I'm trying to populate a table with a years worth of data with the column=PRODUCT and row=month of DATE. Here's the catch, not all of the months will have data. So here's where my problem is, I'm not able to use an IF ELSE statement along with a XDOXSLT:GET_VARIABLE expression so that if there's no data for that month the default value will be 0.
    Can someone help me find a solution to either one of the attempts below or a completely new method? Thanks!
    BP4 = numeric month value using DATE (more code to pull only month from DATE not included here)
    JAN1 = PRICE if data exists, else 0
    1) I tried this and it didn't work:
    <?if: xdoxslt:get_variable($_XDOCTX,'BP4'),01 then xdoxslt:set_variable($_XDOCTX, 'JAN1',PRICE) else xdoxslt:set_variable($_XDOCTX, 'JAN1',0) end if?>
    <?xdoxslt:get_variable($_XDOCTX,'JAN1')?>
    <?end if?>
    2) I tried this and it didn't work:
    <?xdoxslt:ifelse(xdoxslt:get_variable($_XDOCTX,'BP4')='01',xdoxslt:set_variable($_XDOCTX, 'JAN1',PRICE),xdoxslt:set_variable($_XDOCTX, 'JAN1',0))?>
    <?xdoxslt:get_variable($_XDOCTX,'JAN1')?>
    <?end if?>
    3) I tried this and it didn't work:
    <?xdofx:if xdoxslt:get_variable($_XDOCTX,'BP4')='01' then xdoxslt:set_variable($_XDOCTX, 'JAN1',PRICE) else xdoxslt:set_variable($_XDOCTX, 'JAN1',0) end if?>
    <?xdoxslt:get_variable($_XDOCTX,'JAN1')?>
    <?end if?>
    sample XML:
    <ROW>
    <Name>Craig Hernandez</NAME>
    <DATE>2013-01-01T00:00:00.000+08:00</DATE>
    <PRICE>31</PRICE>
    <PRODUCT>BPD</PRODUCT>
    </ROW>
    -DrT
    Edited by: 990965 on Feb 28, 2013 8:27 AM

    let me clarify my logic, the template 1) searches for the relevant PRODUCT (in the case below, it searches for BPD which is the column in the table) 2) searches for the relevant month in DATE (which is the row in the table) 3) if data exists, get PRICE else default to 0
    Variable definitions:
    BP4 = numeric month value from DATE (more code to get this value not included here, but it works...)
    JAN1 = set to PRICE if data exists for that month, else 0
    the query is only pulling all of the existing data, so if there's no data for March then there wouldn't be a March entry in the xml. In the sample xml below, we only have data for the first two months (Jan, Feb) so that's the only data in the xml. I can't check if PRICE is null because the xml will not have any data for March.
    I've read through other threads and it seems that BI Publisher can't use an IF THEN ELSE with the XDOXSLT:GET_VARIABLE. I sent the template and xml to you.
    Sample XML:
    <ROW>
    <Name>Craig Hernandez</NAME>
    <DATE>2013-01-01T00:00:00.000+08:00</DATE>
    <PRICE>31</PRICE>
    <PRODUCT>BPD</PRODUCT>
    </ROW>
    <ROW>
    <Name>Craig Hernandez</NAME>
    <DATE>2013-02-01T00:00:00.000+08:00</DATE>
    <PRICE>30</PRICE>
    <PRODUCT>BPD</PRODUCT>
    </ROW>
    Edited by: 990965 on Feb 28, 2013 8:30 AM

  • Can i use anything else to sync my ipod?

    i keep having the message that my ipod cannot be updated as there is a missing file. I've followed the guide on here and have reinstalled it etc and followed advice on here, but it still doesn't work.
    I'm sick of i-tunes, can I use anything else to put songs on my ipod? I know that media player doesn't recognise ipods, but is there something else I can download to put songs on.
    This is really frustrating me, and I'm thinking of taking my ipod back, have only had it 3 days, but if I can't put anything on it there's no point in me having one.

    You could have a look at Anapod, XPlay or EphPod:
    Anapod Explorer
    XPlay 2
    EphPod
    These programs will all let you manage an iPod however there are a couple of things that they won't do:
    a) You won't be able to update the firmware on your iPod if a new version comes along. The iPod software updater is integrated into iTunes 7
    b) If purchasing iTunes Music is something you wanted to do you won't be able to buy from the iTunes Music store.

  • In which trigger can i use go_item() in oracle forms 6i?

    Hi,
        I have a problem with go_item.
    I tried executing go_item() in triggers like key_next_item, pre_text_item, post_text_item & when_validate_item.
    But none of them seemed to be working.
    I searched for other possibilities in the site, where i found a solution of using trigger ' when_timer_expired ' with ' when_validate_item ' ,
    but when i tried to create trigger, i did not find that trigger (when_timer_expired)  in the list at all.
    I'm using oracle form builder 6i.
    Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production.
    A trigger with go_item() must be created when tab is pressed.
    In which trigger can i use go_item() ??
    Thank You.

    from help:
    Restricted Built-in Subprograms
    Restricted Built-ins affect navigation in your form, either external screen navigation, or internal navigation. You can call these Built-ins only from triggers while no internal navigation is occurring.
    Restricted Built-ins cannot be called from the Pre and Post triggers, which fire when Oracle Forms is navigating from object to another.
    Restricted Built-ins can be called from the When triggers that are specific to interface items, such as When-Button-Pressed or When-Checkbox-Changed. Restricted Built-ins can also be called from any of the When-New-"object"-Instance triggers and from key triggers.
    Unrestricted Built-ins do not affect logical or physical navigation and can be called from any trigger.
    The Built-in descriptions include a heading, Built-In Type, that indicates if the Built-in is restricted or unrestricted.

  • What else can I use beside Compressor?!

    Compressor is now useless to me. Unknown time remaining will not fix. What else can I use? Anyone know?

    Look, we understand your frustration and, since we've been hanging out here a long time, we differentiate newbie issues as separate from actual or legitimate problems by seeking information newbies refuse or simply do not understand how to supply. You've added significant information that will allow us to assist you.
    Compared to the hundreds of thousands of successful and happy Compressor users, "plenty of people" is not significant.
    The next post in this thread suggests your only hope is a complete system wipe and reinstallation. Do you want to try that and report back to us?
    It is useless if it doesnt work and yes I've never gotten to use it. I have used lessons on lynda.com. It's not that I don't know what I'm doing. Try a simpler batch, I was using the simplest of batches. The setting is conventional. I spent time on the phone with 2 different Apple tech people who know compressor. I assure you I have spent the entire day trying to fix this to no avail.
    I've learned that plenty of other people have this same problem with no solution being offered here or from Apple.
    <
    bogiesna

  • How can i use an ao card (pci 6723) to output data and to trigger an ai o acquire the data coming from the ao card?card (pci 6254) t

    Hello
    I am trying to perform AO (pci 6723) and to trigger my AO card (pci
    6254) to read the data coming from the AO card. I am using LV7,1,
    win2000.
    Is an RTSI cable necessary or I can connect the trigger signals externally ?
    I am using the LV example " multi function - synch ai-ao.vi" but i can't for some reason configure the trigger lines.
    thank you in advance for your time.
    Yiannis

    Hello Yiannis,
    If I understand you correctly, you want to synchronize your analog input and analog output that are started by a trigger on the analog input board. If you don't want to use the RTSI lines, your best bet is to export the AI Sample Clock and then read it in to the AO board. There is an example on ni.com called DAQmx - Synchronized AIAO Shared Clock. It appears to be having techincal issues so I have attached the example below. To export ai/sampleclock, use DAQmx Export Signal.vi after Get Terminal Name with Device Prefix.vi. Export Sample Clock to PFI3 (There are only connections between the sample clock and PCI3/4/8/9). Connect PFI3 on your AI board to PFI0 on your AO board (with a wire). Then change the source for the AO Timing.vi to Devx/PFI0. If you want to do triggering, stick the DAQmx Trigger.vi between the Timing property node and the DAQmx Start.vi on the AI task. I have shown how to do this in the modified version below. Please take a look at it and let me know if you have any questions. If you still get an error please take a screenshot of it and post to the forum. Have a great day!
    Sincerely,
    Marni S.
    Attachments:
    Synchronized_AIAO_Shared_Clock[Modified].vi ‏140 KB

  • HT1689 Can i use debit card as a payment method on app store..if not,what else?? in case i don''t have credit card...please help

    Can i use debit card as a payment method on app store..if not,what else?? in case i don''t have credit card...please help

    I don't think that debit cards are still accepted as a valid payment method - they are not listed on this page and there have been a number of posts recently about them being declined. You could try contacting iTunes support but I don't think that you will be able to use it : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page
    If you don't have a credit card then are iTunes gift cards available in your country ? They are not available in all countries and they are country-specific (they can only be used in their country of issue), so you won't be able to use those from another country.

  • Can't able to use :NEW in after insert trigger

    When i am trying to assign value to an element of the NEW pseudo record, its giving error like :new pseudo record can't be used in this type of trigger.
    What exactly i've done is given below
    create or replace triger tri_name
    after insert
    on tab_name
    for each row
    begin
    if :new.x='123' then
    :new.y:=null;
    end if;
    end tri_name;
    Thanks & Regards
    --DKar                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    from oracle documentation...
    Old and new values are available in both BEFORE and AFTER row triggers. A new column value can be assigned in a BEFORE row trigger, but not in an AFTER row trigger (because the triggering statement takes effect before an AFTER row trigger is fired). If a BEFORE row trigger changes the value of new.column, then an AFTER row trigger fired by the same statement sees the change assigned by the BEFORE row trigger.
    for more details read the documentation

Maybe you are looking for

  • OSB conditional branches

    Hi, I have problem with conditional branches in OSB. I have 2 business services and 1 proxy service which route message to one of 2 business services. Conditional branch look like this: XPath: ./ter:process/ter:provider In Variable: provider Terminal

  • IPhoto doesn't launch Correctly

    Every time I launch my iPhoto, the main window doesn't open. I've attempted to choose the library again, with no good results. It appears there's a significant with iPhoto since it will not open your iPhoto library when the app opens. Don't work arou

  • Question on BP?

    Hi Friends what data can be seen when admin monitors suppliers using BBP_SUPP_MONI tcode.With admin access do u think purchaser who has admin role can also make changes on the supplier portal or he can just view what data is changed i.e display role

  • Detete messages in personal folder

    Im not able to send or revice sms messages anymore on my Nokia E72. I have stored alot of my incomming massages in a personal folder on my nokia E72 device. I have approx. 12000 massages in one folder. But lately I cant send or recive messages. I get

  • Default values for standard quote fields?

    Hi all, Is it possible to pass a default value for the quote screen/document, to be more specific, the payment terms field? Can i use the BBP_DOC_CHANGE_BADI~BBP_QUOT_CHANGE? I have reviewed the signature but i can't find the payment term field... Ho