How to write a use time function in elsif

Hai All
I have generated an attendance form and my problem is while i am using elsif insert operation there and there is no updation.
My need is
this is my table structure
EMPCODE NUMBER
EMPNAME VARCHAR2(25)
BARCODE VARCHAR2(25)
INTIME VARCHAR2(25)
OUTTIME VARCHAR2(25)
INTRTIMEIN VARCHAR2(25)
INTROUTTIME VARCHAR2(25)
ATTEND_DATE
when timing between 0145 and 0630 then update in outtime
and 0630 to 1000 then insert in intime column
and 1100 to 1300 then insert in intime column or
update in outtime column and
then 1600 to 1730 then to insert into intime column or else
when intime is not null then update in outtime column
I have tried and only insert id doing opver there Pls tell what wrong i have made
declare
t_in varchar2(25) := :bartime;
     t_out varchar2(25) := :bartime;
-- t_date dail_att.attend_date%type;
Begin
go_block('TEST_SRI');
FIRST_RECORD;
LOOP
if :bartime between 0145 and 0615 and t_out is null and t_in is not null then
update dail_att set outtime = :bartime where barcode= :barcode
and ATTEND_DATE = :BARDATE-1 ;
elsif :bartime between 0630 and 1000 and t_in is null then
insert into dail_att(barcode,intime,attend_date)
values(:barcode,:bartime,:bardate);
elsif :bartime between 0630 and 1000 and t_in is null then
update dail_att set outtime = :bartime where barcode= :barcode
and ATTEND_DATE = :BARDATE-1 ;
elsif:bartime between 1130 and 1330 and t_in is null then
insert into dail_att(barcode,intime,attend_date)
values(:barcode,:bartime,:bardate);
elsif :bartime between 1130 and 1330 and t_in is not null then
insert into dail_att(barcode,intrtimein,attend_date)
values(:barcode,:bartime,:bardate);
elsif :bartime between 1615 and 1815 and t_in is null then
insert into dail_att(barcode,intime,attend_date)
values(:barcode,:bartime,:bardate);
elsif :bartime between 1645 and 2000 and t_in is not null and t_out is null then
update dail_att set outtime = :bartime
where barcode= :barcode and outtime is null and ATTEND_DATE = :BARDATE-1;
elsif :bartime between 2000 and 2200 and t_in is not null and t_out is null then
update dail_att set outtime = :bartime
where barcode= :barcode and outtime is null and ATTEND_DATE = :BARDATE;
EXIT WHEN :SYSTEM.LAST_RECORD = 'TRUE' OR :BARCODE IS NULL;
end if;
NEXT_RECORD;
--message('hai');
END LOOP;
delete from dail_att cascade;
forms_ddl('commit');
forms_ddl('truncate');
exception
when others then
forms_ddl('rollback');
message(sqlerrm||dbms_error_Text);
message(sqlerrm||dbms_error_Text);
End;      
Regards
Srikkanth.M

I got it by converting by date time function
Edited by: Srikkanth.M on Apr 10, 2010 2:19 PM

Similar Messages

  • Using time() function in multithreaded application

    I am using time() function in a multithreaded application with NULL argument for getting current time.
    Some time it's observed that we get a time one minute earlier than current time (3600 seconds).
    Is there a problem in the usage of the function?
    I am using expression : currenttime = time(NULL);
    I had seen some people using following way - time(&currenttime );
    Will above two behaves differently in multithreaded environment?
    [I  am using  Sun C++ 5.5 compiler on Solaris 8]

    How do you compare actual time against the time seen by your threads? If your threads are printing the value from time(2) to stdout, it's possible that you're seeing an artifact of thread scheduling and/or output buffering.
    I really doubt that you have a concurrency problem, but anyway make sure that you include the -mt option on your compile line:
    CC -mt blahblahblah...

  • How to write the exceptions in function module

    dear all,
         how to write the exceptions in function modules with example.
    thanq
    jyothi

    Hi,
    Raising Exceptions
    There are two ABAP statements for raising exceptions. They can only be used in function modules:
    RAISE except.
    und
    MESSAGE.....RAISING except.
    The effect of these statements depends on whether the calling program handles the exception or not. The calling program handles an exception If the name of the except exception or OTHERS is specified after the EXCEPTION option of the CALL FUNCTION statement.
    If the calling program does not handle the exception
    · The RAISEstatement terminates the program and switches to debugging mode.
    · The MESSAGE..... RAISING statement displays the specified message. Processing is continued in relation to the message type.
    If the calling program handles the exception, both statements return control to the program. No values are transferred. The MESSAGE..... RAISING statement does not display a message. Instead, it fills the system fields sy-msgid, sy-msgty, sy-msgno , and SY-MSGV1 to SY-MSGV4.
    Source Code of READ_SPFLI_INTO_TABLE
    The entire source code of READ_SPFLI_INTO_TABLE looks like this:
    FUNCTION read_spfli_into_table.
    ""Local Interface:
    *" IMPORTING
    *" VALUE(ID) LIKE SPFLI-CARRID DEFAULT 'LH '
    *" EXPORTING
    *" VALUE(ITAB) TYPE SPFLI_TAB
    *" EXCEPTIONS
    *" NOT_FOUND
    SELECT * FROM spfli INTO TABLE itab WHERE carrid = id.
    IF sy-subrc NE 0.
    MESSAGE e007(at) RAISING not_found.
    ENDIF.
    ENDFUNCTION.
    The function module reads all of the data from the database table SPFLI where the key field CARRID is equal to the import parameter ID and places the entries that it finds into the internal table spfli_tab. If it cannot find any entries, the exception NOT_FOUND is triggered with MESSAGE ... RAISING. Otherwise, the table is passed to the caller as an exporting parameter.
    Calling READ_SPFLI_INTO_TABLE
    The following program calls the function module READ_SPFLI_INTO_TABLE:
    REPORT demo_mod_tech_fb_read_spfli.
    PARAMETERS carrier TYPE s_carr_id.
    DATA: jtab TYPE spfli_tab,
    wa LIKE LINE OF jtab.
    CALL FUNCTION 'READ_SPFLI_INTO_TABLE'
    EXPORTING
    id = carrier
    IMPORTING
    itab = jtab
    EXCEPTIONS
    not_found = 1
    OTHERS = 2.
    CASE sy-subrc.
    WHEN 1.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno.
    WHEN 2.
    MESSAGE e702(at).
    ENDCASE.
    LOOP AT jtab INTO wa.
    WRITE: / wa-carrid, wa-connid, wa-cityfrom, wa-cityto.
    ENDLOOP.
    The actual parameters carrier and jtab have the same data types as their corresponding interface parameters in the function module. The exception NOT_FOUND is handled in the program. It displays the same message that the function module would have displayed had it handled the error.
    Or
    just have to decide what exceptions u want and under what conditions.
    then declarethese exeptions under the exceptions tab.
    in the source code of ur function module.
    if
    like this u can code .
    now when u call the function module in tme mainprogram.
    if some error occurs and u have declared a exception for this then it will set sy-subrc = value u give inthe call of this fm.
    in the fm u can program these sy-subrc values and trigger the code for ur exception.
    Please reward if useful
    Regards,
    Ravi
    Edited by: Ravikanth Alapati on Mar 27, 2008 9:36 AM

  • After a clean install, how can I continue using Time Machine?

    After a clean install, how can I continue using Time Machine?
    I booted from my recovery partition, erased my HD, installed the same OS, (Lion, 10.7.5) then restored from my TM.
    If it asks if i want to use TM, I say yes. When I chose the drive, it seems to want to start all over, instead of just picking up where I left off.
    Is there any way of picking up where I left off?

    Hi Frank,
    You are sure you looking in your Library in /Users/YOUR_USERNAME/Library and not /Library at the top level of your harddrive?
    When you open iCal what do you see?  Are the calendars the two default Home and Work ones?
    I really appreciate the responses -- especially if you are in the UK as opposed to Ontario.
    Why, do you have something against London Ontario?
    John M

  • How to use Time Function

    I have two times say
    2310, 0050 - How can I find out using java that the difference between these two is 100 minutes or 1 hour 40 minutes.
    What libraries are used to find this out ??

    I need a time function which will do it.....I will be
    surprised if Java don't have something inbuilt....Try splitting the time into two strings for the hours and minutes, using the functions DrLaszloJamf provided for you.
    minutesSinceMidnight = hours * 60 + minutes; Otherwise, the GregorianCalendar is pretty cool.

  • How can i measure the transmision time in gpib with visual basic with more precision if i use time() function?

    I want to take a measurement of the time that i use to make a gpib transmision in a Visual Basic program,i use the function TIME() to take the time in the begining and other time in the end,but this way only give me precision of seconds, and i want miliseconds,can i use other function,other way?
    Can answer in spanish?

    Try using GetTickCount() API function, which provides millisecond precision. If you need more precise timer, try using QueryPerformanceCounter() function.
    Makoto

  • How get OBJECT_ID for using ARCHIV_BARCODE_GLOBAL function?

    Hello experts:
    Do you know how can I get the object_id that I must fill for using ARCHIV_BARCODE_GLOBAL function?
    Please any help is very helpfull.
    Best regards and thanks in advance for your time.
    Miriam

    I think you can get this in the interface. Ideally this gets populated in TOA01 or TOA02 or TOA03 table.
    also check table
    BDS_BAR_EX
    BDS_BAR_IN
    Thanks
    Arghadip

  • How to replace F4 using another function key

    Experts:
       How can i change the search help function key F4, using another function key,for example F11, when i press F11 the system perform the search help.
    thanks!

    you can do this using menus/buttons(dialog programming) and there you can define your short keys, and event can be trapped by sy-ucomm in the program. Menu can be set by writting set PF-Status 'MENUNAME' or using se37.

  • How to plot contour using time stamp

    Hello,
    I need help on the following:
    I acquire size distribution data each minute from a particle counter. I would like to plot the data as a contour plot using time stamp on the x-axis, the size bins on the y-axis and the 2D data on the z-axis. I cannot get the contour functionality in LV 2011 to accept the time stamp format. I did change the format of the x-axis to "absolute time" but it still doesn't work, see simplified diagram below.
    Any advice on reformatting a time stamp to something the contour plot understands??!?
    Thanks a lot,
    Claus
    Attachments:
    countour.png ‏20 KB

    Milan R wrote:
    Hi Mogensen!
    You could use the "To Double Precision Float" vi to convert the timestamp to a double prescion number as mentioned in this forum post "time stamp to number function". As mentioned in that forum, the number is based on the LabVIEW epoch date so you can use it to compare values taken at a specific time.
    I can't look right now but will that work?
    I thought the 3D stuff was single and the magnitude of the time stamp would swamp the difference in time stamps.
    Just thinking out loud.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How to filter group using in function

    Hey
    i am trying to do a group filter in the data model using IN function
    g.segment3 in ('401000', '401010', '401020', '409100')
    how can i configure the filter is in one of these values ?
    i tried the
    g.segment3 in ('401000', '401010', '401020', '409100') but its showing me an error
    any reason why ?
    thanks

    Hey
    i am trying to do a group filter in the data model using IN function
    g.segment3 in ('401000', '401010', '401020', '409100')
    how can i configure the filter is in one of these values ?
    i tried the
    g.segment3 in ('401000', '401010', '401020', '409100') but its showing me an error
    any reason why ?
    thanks

  • How to get bytes[] using jni functions

    I am new to JNI and have a question. I have a java class which returns back bytes[]
    I have the class jclass for the object and the jmethodid bytesMethodID which is mapped like this:
    bytesMethodID = (*env)->GetMethodID(env, objcls, "bytes", "()[B");
    now in the c impementation I have a stuct pointer
    DESIGN_STRUCT *str= NULL;
    How do I assign the bytes[] into this struct pointer? If I do the following:
    str = (*env)->CallObjectMethod(env, obj, bytesMethod());
    I get a "assignment from incompatible pointer type" if I change that to:
    str = (*env)->CallBytesMethod(env, obj, bytesMethod());]
    I get a "assignment makes pointer from integer without a cast"
    My question is what JNI function do i use to get back a byte[]
    Any help and pointers greatly appreciated.
    Thanks,

    You should use CallObjectMethod() and cast the return value to a jbyteArray. Then you need to use a function like GetByteArrayElements() to actually retrieve the individual elements in that array.
    God bless,
    -Toby Reyelts
    Check out the free, open-source, JNI toolkit, Jace - http://jace.reyelts.com/jace.

  • Does anyone know how to add time using TIME function?

    Hi,
    I just switched from Excel (lol) and found an error in a key calculation i use. Does anyone know how to automatically add hours to a time? i.e. i have to convert Pacific Time to other U.S. Time Zones so in the past I used this formula in Excel (=B6+TIME(3,0,0)) which is now not working in Numbers. Is there an equivalent?
    Thanks for your help!
    Alexandra

    Hello
    The Terms of Use ruling this forum states:
    -+-+-+-+-+-+-+-
    +to help you resolve issues, ask questions, get tips and advice, and more.+
    +If you have a technical question about an Apple product, be sure to check out Apple's support resources first by consulting the application Help menu on your computer and visiting our Support site to view articles and more on our product support pages.+
    +How do I post a question? ‚+
    +_If you searched the forums and didn't find an answer to your question or issue_, click the Post New Topic link at the top of a relevant forum page to post your own question.+
    -+-+-+-+-+-+-+-
    Your question was aked and responded many times.
    Searching in existing threads would have give you the response.
    When I try to help users in English, I often look in a dictionary but it seems that for many users, reading the Help or the PDF User's Guideis too much work.
    In cell D3, the formula is simply:
    =TIME(HOUR(B)HOUR(C),MINUTE(B)+MINUTE(C),SECOND(B)SECOND(C))
    which match the Numbers's syntax which, what a surprise, is not XL's one
    Yvan KOENIG (from FRANCE mercredi 28 mai 2008 17:39:56)

  • Using Timer functions in parallel with VISA functions

    I have an application using two VISA sessions operating
    in parallel controlling a LeCroy oscilloscope and a Pacific
    Power Source through GPIB.
    In a sub-VI, I setup the scope and put it in single acquistion
    mode. Then, in the top level VI, I am reading a global variable
    that detects when the scope is armed - when this flag is set, I am
    using the second VISA session to control the power to the circuit
    under test.
    I have a while loop with a small delay (100ms) to poll the
    global variable, (I also use the global value to exit the loop.)
    This technique does work, although there is a 10 second delay
    between the time the scope is armed for acquisition and the time
    the command is recieved to turn on th
    e power source.
    If I take the Wait(mS) function out of the while loop, the command is
    sent immediately following when the scope is armed, with no delay,
    and even though I don't seem to be missing the trigger, I would prefer
    just a small delay, to ensure that the scope is ready every time. Also,
    from what I've read, it's not good practice to run loops without even
    some small delay.
    Is there a better approach to this? I hope I have expained the
    problem sufficiently - any help or insight would be appreciated.
    thanks,
    Mike Selecky

    I understand the structure you're talking about, but I don't understand why they have to be in seperate loops. The flag from the scope (actually the error cluster output from the scope command function) is the data that establishes the sequentiality between the two steps. If errors are handled properly in the scope and power supply subVIs all you have to do is string the teo routines together using the error clusters and you're done.
    What you want in the subVIs is to create them such that the first time they run they initialize the VISA session and store the reference to it in an uninitialized shift register. Every time after that (or until an error is detected after the command operation) the part of the code that reads or writes the instrum
    ent uses the cached reference. To allow the code to stop cleanly, you might also want to include a front panel control that tells the subVI that the system is shutting down and to close the VISA session when it's done with it.
    Errors propegated into a subVI containing VISA calls will essentially bypass those calls as long as all the error clusters are connected together. What actually happens is that the low-level functions abort as soon as they see the error input and simply pass the error in to their error output.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • How to write SDO_GEOMETRY using PreparedStatements ?

    Hi there,
    I use JDBC and JDK 1.3+
    Currently I'm writing geometries into Spatial by using Strings and
    I meet some limitations for very huge geometries.
    That's why I need to use PreparedStatements and parameters to get
    rid of this limitation.
    My question is how can I write Object types by using JDBC. All
    the sample codes I found use oracle.sql and oracle.jdbc packages.
    My problem is that my code can be used by people that may not
    have an Oracle jdbc driver like "thin" for instance.
    thanks for your help,
    ALI

    Justin,
    I have a PL/SQL package that contains several functions. One of them does selection and filtering of spatial features based on a user's location and preferences. For this purpose a web-application runs this function.
    I would like this function to do the following:
    1. the function is called, user parameters are passed in
    2. a call to a java-stored-procedure is made. This java procedure creates a polygon based on the user's location and preferences.
    3. the polygon is returned to the PL/SQL function
    4. the funtion uses the returned polygon to query spatial features that intersect, etc.
    I can do the call to the java-stored-procedure but where I get stuck is how to get the polygon from java to pl/sql. I can return a String or a number from java but how can I return the polygon (e.g., STRUCT, java object)?
    The current solution uses a work-around by storing the polygon in a temporary table. I would like to change this because once the function has run, the polygon is not needed anymore so I would like to do without having to store the polygon.
    Markus

  • Error using time function AGO()

    Hi everyone
    I am trying to make this report using OBIEE 11.1.5 with Essabas as datasource:
    Account     ActualMonth     MonthPreviousYear     PreviousMonth     Actual Year
    I have the time dimension (like in HFM), divided into two dimensions Years (Total -> Years) and Period (Total -> Quarters -> Months).
    I use the AGO() function in the repository (BML) to get PreviousYear and PreviousMonth:
    PreviousYear: AGO("Essbase_1"."Data"."Measure" , " Essbase_1"."Year"."Gen2,Year" ,1)
    PreviousMonth : AGO("Essbase_1"."Data"."Measure" , " Essbase_1"."Period"."Gen4,Period" , 1)
    If I use the columns PreviousMonth or PreviousYear separately they work fine. However using both in the same query, I get an error:
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 43119] Query Failed: [nQSError: 22036] Level in Ago function (Gen2,Year) must be a rollup of (or equivalent to) the measure level (Gen4,Period). (HY000)
    Any idea how to solve this issue?
    Many Thanks in advance
    Mojito

    Look at the following links:
    http://obiee101.blogspot.com/2008/11/obiee-ago-and-todate-series.html
    http://oraclebiee11g.blogspot.com/2011/01/ago-function-in-obiee-11g-answers.html
    hope this helps.

Maybe you are looking for

  • Multiple photo block issues?

    Hello, When I put multiple photo "blocks" in an iWeb Photo page, iWeb seems to do two odd things: 1. The slideshow only sees one of the two blocks - can't tell the pattern, whether it is the one on top or on the bottom. 2. When I click on the individ

  • EFI/refind boot- how to get kernel vmlinuz in /boot/efi/EFI/arch?

    I have a MacBook Pro Retina (10,2) running arch. It EFI boots using rEFInd, booting from /boot/efi/EFI/arch. This problem has been happening since I first installed the system in July - when I use pacman to update to the latest kernel, the mkinitcpio

  • CC Desktop App Download Error

    I cannot access any of my CC apps due to a download error with the Creative Cloud desktop app.  In the CC desktop app, under the 'Apps' tab, I should be seeing all my downloadable/updatable/etc CC apps, but I am instead presented with 'Download Error

  • IDoc to HTTP communication....Is B2B required?

    Hi All, I have a scenario where I have to communicate from SAP IDoc to a 3rd party via HTTP communication. Please tell me if I have to configure this as a B2B or A2A. Is it must to use B2B for Idoc communication with 3rd party. If yes then please let

  • Is there a slice tool in Photoshop CS5?

    I am using Photoshop CS5. I wanted to slice images in my .psd file and Save As an html to edit in DreamWeaver but i wont find the slice tool, is there another tool that replaced it or i should seperately install it? KChimwanda: [email protected]