How to write a if else logic expression for this condition

Hai All
I have written some if else logic for for my condition
If the time is betweeb 0145 and 0630 and timeout is a column in a table is null than update sysdate-1
then if time is bet0645 and 0900 then timein is null then insert into timein in table called dail_att
and time bet 1130 and 1300 then if barcode null then insert timein else update timeout
and bet 1645 and1730 then if barcode null and timein null then insert timein or update time out
this is my condition for generating attendance. Ive tried some logic and pls tell case executed faster than ifelse logic
and give me a soluton
This is my coding
if :bartime between 0145 and 0630 and :barcode is not null then
update dail_att
set timeout = :bartime
where barcode= :barcode
and timein is not null
and ATTEND_DATE = :BARDATE-1;
else if :bartime between 0645 and 0900 and :barcode is null then
insert into dail_att(barcode,timein,attend_date)
values(:barcode,:bartime,:bardate);
else if     :bartime between 1145 and 1300 and :barcode is null then
     insert into dail_att(barcode,timein,attend_date)
values(:barcode,:bartime,:bardate);
else
     update dail_att
set timeout = :bartime
where barcode= :barcode
and ATTEND_DATE = :BARDATE ;
end if;
else if :bartime between 1645 and 1730 and :barcode is null then
          insert into dail_att(barcode,timein,attend_date)
values(:barcode,:bartime,:bardate);
else
     update dail_att
set timeout = :bartime
where barcode= :barcode
and ATTEND_DATE = :BARDATE ;
end if;
else :bartime > 1730 and :barcode is null then
     update dail_att
set timeout = :bartime
where barcode= :barcode
and ATTEND_DATE = :BARDATE ;
end if ;
EXIT WHEN :SYSTEM.LAST_RECORD = 'TRUE' OR :BARCODE IS NULL;
NEXT_RECORD;
forms_ddl('commit');
end loop;
Regards
Srikkanth.M

Hai Sir
I am storing time in 24hrs format and its datatype is varchar.Pls tell me we can write an if else with in a elseif
Regards
Srikkanth.M

Similar Messages

  • HOW TO WRITE QUERY OR PL/SQL PROGRAM FOR THIS

    I HAVE TABLE X
    SELECT ENO FROM X
    ENO
    123
    423
    332
    562
    678
    986
    621
    WHEN I RUN PL/SQL PROGRAM I WILL PASS PARAMETER
    FOR EXAMPLE LIKE 134
    I NEED OUTPUT LIKE
    134 EXIST OUTPUT
    123
    423
    332
    562
    621
    134 NOT EXIST OUTPUT
    678
    986
    Regards
    Dev

    This?
    <tested in TOAD>
    SQL> accept my_parm
    old: with t as (
    select '123' eno from dual union all
    select '423' from dual union all
    select '332' from dual union all
    select '562' from dual union all
    select '678' from dual union all
    select '986' from dual union all
    select '621' from dual )
    select eno || ' ' || output_type results
    from (
    select to_char(&&my_parm) eno, 'EXIST OUTPUT' output_type, 1 output_id
    from dual union all
    select null eno, null output_type, 3 output_id
    from dual union all
    select to_char(&&my_parm) eno, 'NOT EXIST OUTPUT' output_type, 4 output_id
    from dual union all
    select
    eno,
    null,
    case when regexp_instr(eno,'[' || &&my_parm || ']') >0
    then 2
    else 5
    end output_id
    from t
    order by output_id, eno
    new: with t as (
       select '123' eno from dual union all
       select '423' from dual union all
       select '332' from dual union all
       select '562' from dual union all
       select '678' from dual union all
       select '986' from dual union all
       select '621' from dual )
    select eno || ' ' || output_type results
    from (
       select to_char(134) eno, 'EXIST OUTPUT' output_type, 1 output_id
       from dual union all
       select null eno, null output_type, 3 output_id
       from dual union all
       select to_char(134) eno, 'NOT EXIST OUTPUT' output_type, 4 output_id
       from dual union all
       select  
          eno,
          null,
          case when regexp_instr(eno,'[' || 134 || ']') >0
             then 2
             else 5
          end output_id
       from t
    order by output_id, eno
    SQL> with t as (
       select '123' eno from dual union all
       select '423' from dual union all
       select '332' from dual union all
       select '562' from dual union all
       select '678' from dual union all
       select '986' from dual union all
       select '621' from dual )
    select eno || ' ' || output_type results
    from (
       select to_char(134) eno, 'EXIST OUTPUT' output_type, 1 output_id
       from dual union all
       select null eno, null output_type, 3 output_id
       from dual union all
       select to_char(134) eno, 'NOT EXIST OUTPUT' output_type, 4 output_id
       from dual union all
       select  
          eno,
          null,
          case when regexp_instr(eno,'[' || 134 || ']') >0
             then 2
             else 5
          end output_id
       from t
    order by output_id, eno
    RESULTS            
    134 EXIST OUTPUT   
    123                
    332                
    423                
    621                
    134 NOT EXIST OUTPUT
    562                
    678                
    986                
    10 rows selected.Message was edited by:
    MScallion

  • I have just bought a 2011 iMac (2.5 ghz, 4gb) and logic express 9, and when i installed logic and tried to run it i had a message saying 'you can't use this version of the application logic express with this version of Mac OS X. How do i sort this out!?

    I have just bought a 2011 iMac (2.5 ghz, 4gb) and logic express 9, and when i installed logic and tried to run it i had a message saying 'you can't use this version of the application logic express with this version of Mac OS X. How do i sort this out!? It is very frustrating as the main reason i have bought  a mac is to use logic! Any help would be great as i am a complete novice when it comes to Macs!

    You're probably on OS X Lion?
    I had the same problem as you. I used Software Update to update Logic Express to the latest version, and then it ran without any problems.

  • Grouping the logical expressions in IF condition is not working

    Hi Experts,
        My requirement is to group the logical expressions in IF condition like the below
    I tried it like
    IF ( &NAST-KSCHL& = 'ZBE0' OR &NAST-KSCHL& = 'ZBEC' ) AND ( &VBDKR-SPRAS& <> 'F' )
      code...
    ELSEIF
      Code....
    ELSE
       code...
    ENDIF
    But the system is showing the grouping in the IF condition is wrong. The problem is i am not supposed to break that AND condition and put it as another IF inside the first IF condition.
    Pls provide your valuable inputs.
    Thanks,
      Srinivas

    Hi,
    Sometimes to play with sap script editor becomes very much difficult if you have scenario like as you mentioned..
    Type this, and i hope it will work..
    /:     IF &NAST-KSCHL& = 'ZBE0' OR &NAST-KSCHL& = 'ZBEC'   
    /:     IF &VBDKR-SPRAS& =  'F'
    your code..
    /:     ENDIF
    /:     ELSEIF <LOGICAL EXP>
    /:     IF &VBDKR-SPRAS& =  'F'
    your code..
    /:     ENDIF
    /:     ENDIF
    Now please try to use one more IF statement, give the logical expression same as in ELSEIF
    Although it is time consuming  but sill you can try..
    Edited by: Lokesh Tarey on May 26, 2010 12:30 PM

  • How to set up and configure AirPort Express for AirPlay and iTunes

    Saw somewhere that supposedly there were some apple written guidlines on the above topic. I have searched all over for them. Anyone know where I can get a copy to read through. Just trying to educate myself a bit and sety up another room with access to itunes, radio, etc with high quality speakers and amp off my express.

    Here you go ...
    How to set up and configure AirPort Express for AirPlay and iTunes

  • Sountrack or Logic/Logic Express for voice over recording?

    Hello,
    I am wondering which software is best for voice over work? Sountrack or Logic/Logic Express?
    Any input would be great. I would add the standard effects/filters to certain voice overs and add sound effects and music.
    I have a midi/guitar and garage band is enough for me. I would not want to use Garageband as my software of choice for voice over work. I want markers and other more advanced tools?
    Thanks,
    Erik

    Thanks for the answer.
    I was looking at the Dialogue Tools in Sountrack and they appear to be perfect.
    My main questrion is can record into Sountrack with a mic right? I have an m-audio saphire with a m-audio preamp.
    I saw a demo of Soundtrack at NAB and all the effects looked perfect for voice over. I think Logic Studio is overkill but Sountrack and Logic Express( for my guitar) might be a perfect 1-2 punch. I will get Sountrack with The Final Cut Studio as I need video tools as well.
    Thanks,
    Erik

  • How to add a feild as key combination for existing condition table

    Hi all,
    please any body can inform me about how to add a feild as key combination for existing condition table ex 901 having the key combination of sales organisation and material
    for this cond. table,how  to add a new feild ex:price list
    iam unable to add it in change mode of v/03.(even after removing this 901 table from Acc.seq.)
    Edited by: rajendraprasad vasam on Apr 25, 2008 10:08 AM

    mr.Rajendra
         I you have the access key - you can copy the 901 table and create a new table along with your required field. v/03
    Or
    in the access sequence for the condition type - add 1 more step and add your field.
    ie 10 - 901
    and in 20 - your required field
    regards,
    Reshmi
    Edited by: reshmi bhaskar on Apr 25, 2008 10:21 AM

  • How to connect my Alesis to Logic Express Pro, running on an Intel Mac Mini

    Hi,
    would anyone possibly have an idea how to connect my Alesis Multimix 8 USB to Logic Express 7,2?
    The Alesis has a USB out. But I don't see anything in the L/E documentation on USB connections.
    I'm hopeful there's another way.
    Thanks very much.
    -peter

    LE documentation won't give instructions for use of 3rd party equipment, except possibly generically.
    Have you downloaded the latest drivers? If it is a USB item, perhaps you are meant to plug in the USB cable rather than wishing it was something else.

  • How many computers can I install Logic Express?

    I'm wondering on how many of my current Macs I can install one license of Logic Express on.

    See
    http://discussions.apple.com/thread.jspa?messageID=6984011&#6984011

  • $5 Starbucks card to first successful answer: how to import midi timecode into Logic Express 9 from Roland VS-880 or Ensoniq ASR-10

    I will literally mail a $5 Starbucks card or gift $5 via paypal to the first person whose response gets me success.  Then after all responses are provided and I'm successful with my issue, I'll also raffle off $5 to one of ALL respondents by random pick. 
    Problem/question:
    I can't figure out how to import midi timecode data from either an Ensoniq ASR-10 or Roland VS-880 Vxpanded into Logic Express 9, so I can then use Logic Express 9 as the master.  No manuals seem to explain that; I just can't find it.
    Background/basics:
    1.  My ultimate goal will be to move all midi data from the Ensoniq ASR-10 floppies and all digital audio files from the VS-880 into Logic Express 9.  Once the midi timing is imported into a Logic Express 9 file, I'll import the data from the Ensoniq & Roland via steps 2a & 2b below.
    1a.  Ten years ago I somehow (am in the process of re-learning what I did 10 years ago) imported the midi timing into the Roland VS-880 Vxpanded from the ASR-10, and then used the VS-880 as the Master to control the ASR-10.   So my current status is that I use the Roland VS-880 as the master, and the Ensoniq ASR-10 as the slave.
    2.  FYI for anyone who might be in the same boat, wanting to transfer stuff from an Ensoniq ASR-10 and Roland VS-880 to the computer:
    2a.  I will import all midi sequence data from my ASR-10 floppy disks via a utility purchased here, which will all a PC to read Ensoniq-formatted disks, and then just hopefully cut/paste midi files into Logic Express 9 (FYI only):  www.chickensys.com
    2b.  Then will import all the individual WAV files from my Roland VS-880 to Logic Express 9 using a method learned here (FYI only): http://www.vsplanet.com/ubbthreads/ubbthreads.php?ubb=showflat&Number=985974&PHP SESSID=b1d2f57be4a1d37d49787400213b22df
    2c.  I'll then combine them all into Logic Express 9.
    So - how the heck do I capture/import the midi timecode into Logic from either the roland or ensoniq using midi?
    I'm don't think that cutting/pasting the midi data into a Logic Express 9 sequence file (step 2a above) will do that, because there are all kinds of tempo & time signature changes in the midi files unfortunately.
    THANK YOU and Merry Christmas!!
    Andy

    OK doesn't look possible.  Closing discussion. 

  • How to run Amp Farm in Logic Express 8?

    I'm new to all this so any help would be greatly appreciated! . . . . . .
    Im running Logic Express 8 without any problems, I've just installed Line 6 Amp Farm and that runs without a problem. The problem I am having is-
    I want to run Logic and use the sounds/amps from Amp Farm but cant figure out how to do it? I've searched the net and cant find anything about how to do it, I've also had a good look through the Logic user guide but had no luck. . . . . . .
    HELP PLEASE!
    John.

    Heres where I'm at so far-
    I've been into Logic and opened Preferences/Audio Units Manager and then validated Pod Farm.
    I go into Browser and Library on the far right to find tones on the far right of the Logic interface, I can find all the Garageband tones/sounds and all the Logic tones/Sounds but there's nothing related to line 6 Farm. The only way I can get into the line 6 stuff is to use the browser and go - Documents/Line 6/Tones/Pod Farm/Guitar/then into the folders where the tones are but the folders seem empty.
    I know the folders aren't empty because if I go into them normally, not using Logic, all the tones are there in the relevant folders and when they are clicked on it opens Pod farm.

  • How do you arrange instruments in logic express?

    Hi,
    I am new to Logic Express 9. I have created an 8 bar song and I want to make it longer and arrange my track so I can remove and add sounds as the song goes along. For example Remove a piano at bar 4 and have a guitar playing at bar 8. How can I do this?
    Thanks

    Did you assign the delay on the vocal track's "Insert" button? If so, this could be the reason your vocals sound jumbled. You can always lower the "wet" signal in the delay itself, but I find that the following method works best when using reverb and/or delay:
    1. From the Arrange window, select/click the vocal track you want to use delay on.
    2. Looking at your track on the left hand side of the screen, right below "Sends," hold-click on the button and select Bus>Bus 1(or whichever one you want)
    3. An "Aux" track will appear right next to your vocal track.
    4. Load either delay or reverb on the inserts and choose the appropriate setting. I prefer using either Stereo or Tape delay since they have better options to work with.
    5. On your vocal track, on your "Sends," you can turn up the volume right next to it, which controls how much of your vocal track you want to send to the aux to get that reverb/delay. Start with -10 db and work your way from there. You should notice a difference by then. You can also control the fader from the Aux as well.
    As far as fadeouts are concerned, I haven't really figured that out. I normally fade out when I use a separate mastering suite, but you can also fade out manually using the Automation method on the Master fader.
    Hope that helps.

  • How to do IF THEN  ELSE logic in Workflow?

    I need to do "if then else" logic in Workflow. The key part of the probem is that there are several "else" (elsif) possibilities, so I can't use a Boolean or Yes/No as a return result code. When I use a function, I can't see a way to "check" the value before it passes to a next process. HELP!

    Whether you are using a function as your comparator or the Standard WF Compare Operators, this can be done. I will explain two scenarios, one with your own written functions as the comparator and the other using the standard Compare Text function.
    Create a PL/SQL procedure that returns a boolean. In this procedure you would pull two attributes from the workflow, the test case and the value you want to compare to. You would check to see if they are equal and return true, otherwise false. I do not know what you are trying to compare in your if statement, but whatever it is, if its true, return true, otherwise false.
    Now in the workflow, you would put a couple of these in your process diagram representing each if statement. Set the two (or more) attributes in the Node Attributes tab of each function node to the values you want to compare. For the first node, have the <true> transition go to whatever you want done and then to an END node. Have the <default> or <false> transition point to the next function node you have. Do the same for each one except at the last one, its only transition would be <default> and that would go to END. This way if the first function resolves true, it will do whatever should be done and then skip the rest of the conditions. If its false, it will go to the next conditional. The last one will be gotten to only if every other conditional was false that would be your final else statement.
    To do this with the Compare Text option, have the same set up in your workflow diagram exception have the <EQUALS> be your true path and the <DEFAULT> transition go to the next compare text node.
    -->O-{default}->O-{default}->O->default
         |                 |                 |             |
        true           true            true           |
         |                 |                 |             |
      doWork     doWork     doWork      else
         |                 |                 |             |
          ---------------->---------------->------------|
                                                          |
                                                      end

  • How many computers can I install Logic Express on?

    Simple question...can I buy one copy of Logic Express and install it on both my Macbook Pro and my new iMac when I get it? I can't see anywhere on Apple's site any info on the software product licences. I also need to know the same information for Final Cut express.

    Christian,
    Thanks for that, I was beginning to think I wouldn't get an answer to this question. I will be using only one of these computers for music production at a time so that will be fine. I will probably use the iMac at home and the Macbook Pro when away and I didn't want to have to buy two copies.

  • How many computers can I install logic express 9?

    How many computers can I install Logic 9 on?

    See: http://images.apple.com/legal/sla/docs/logicexpress.pdf
    2 computers - one desktop and one laptop and not running at the same time.

Maybe you are looking for

  • Item Codes and Revisions to Items

    Hi Experts! I have a client who does Custom Manufacturing. I have a question about Item Codes and Revisions. My understanding is that it is better to use a unique Item Code for each change to an Item. Therefore every revision would have a new Item Co

  • Missing steps in Job History

    Hi, I am having this strange issue where in the job some steps are missing. There are 20 steps out of which in the job history the first 4 steps are not showing up. The packages being called in these 4 steps are running successfully. Also, in job his

  • Saving photos that are sent to iphone?

    I can't seem to save photos to camera roll, that have been emailed to my iphone. Any ideas?

  • Elements 9 organizer problem

    I am unable to get a menu bar in Organizer ....need to do this in order to import photos from my scanner. Was able to do this before.  Also can only access Organizer through Editor.   Wondering if I should uninstall and then reinstall or is there a q

  • Which iWorks is compatible with OS X 10.6.4?

    Looking to purchase iWorks but cannot download from the app store as I am only working of an OS X 10.6.4 and I don't want to update. Can I simply buy an old iWorks programme and if so which one?