How to insert log In & Log Out Time in to Table

hi,
i have create a login form there are three textfield
Username
Passward
request is for identify user is admin or User
i have create two table for login details
CREATE TABLE "USERS"
(     "USER_ID" VARCHAR2(10) NOT NULL ENABLE,
     "PASSWORD" VARCHAR2(30),
     "EMAIL_ID" VARCHAR2(50),
     "ROLE" VARCHAR2(1),
     "PHONE_NO" VARCHAR2(15),
     "EMP_ID" NUMBER,
     CONSTRAINT "USERS_PK" PRIMARY KEY ("USER_ID") ENABLE
CREATE TABLE "USER_RECORD"
(     "SERIAL" NUMBER NOT NULL ENABLE,
     "USER_ID" VARCHAR2(10),
     "LOGIN_TIME" VARCHAR2(20) NOT NULL ENABLE,
     "DTE" DATE,
     "LOGOUT_TIME" VARCHAR2(20),
     "STATUS" VARCHAR2(1),
     CONSTRAINT "USER_RECORD_PK" PRIMARY KEY ("SERIAL") ENABLE
DECLARE
V_ROLE VARCHAR2(1);
BEGIN
SELECT ROLE INTO V_ROLE FROM USERS
WHERE USER_ID =:P68_USERNAME;
INSERT INTO USER_RECORD
VALUES(:P68_S_NO,:P68_USERNAME,TO_CHAR(SYSDATE,'HH24:MI:SS'),TO_DATE(SYSDATE,'DD-MON-YYYY'),NULL,'N');
END;
i am using this code to insert login time in to table USER_RECORD.
now i have create log out Navigation Bar on every page ,i want when i click on any on logout link in upper side of page then the logout time should go into USER_RECORD table in LOGOUT_TIME column.
How can i do this.
Thanks
Manoj

Hello
Well, i have read and tried to understand what is your goal..
The goal is to record a user when they log out, right?I have implemented something in a very similar way and I remember I read it once...from a blog...quite easy...
Here is the way to implement it...
On the log out URL.. divert it to a single page lets say page: 99..
f?p=&APP_ID.:99:&APP_SESSION.Page 99 will be a special page which is called when a user logs out of your application right...
Now..then create an application which you will load before the header....
The job of this application process will be to insert the required information in your table, your code:
INSERT INTO USER_RECORD
VALUES(:P68_S_NO,:P68_USERNAME,TO_CHAR(SYSDATE,'HH24:MI:SS'),TO_DATE(SYSDATE,'DD-MON-YYYY'),NULL,'N');then call a APEX LOG OUT FUNCTIONS which will invalidate session and redirect user to your default log in page: 101<APEX default Authentication Scheme>
like
wwv_flow_custom_auth_std.logout( p_this_flow=>:APP_ID,p_next_flow_page_sess=>:APP_ID ||'.:101');
This APEX Function will logout user, and then redirect the user to the next page with a new session id to your default page
like i have added it below
BEGIN
SELECT ROLE INTO V_ROLE FROM USERS
WHERE USER_ID =:P68_USERNAME;
INSERT INTO USER_RECORD
VALUES(:P68_S_NO,:P68_USERNAME,TO_CHAR(SYSDATE,'HH24:MI:SS'),TO_DATE(SYSDATE,'DD-MON-YYYY'),NULL,'N');
wwv_flow_custom_auth_std.logout( p_this_flow=>:APP_ID,p_next_flow_page_sess=>:APP_ID ||'.:101');
END;this processes should be done in default like when before a page is loaded...that is my magic trick
Hope I was able to help.
Regards,
Noel Alex Makumuli,
Tanzania

Similar Messages

  • I have 2 iphones, one for personal and one for business.  I need my phones not to sync otherwise they will both ring all the time.  How can I log out of my icloud and unsync my phones?

    I have 2 iphones, one for personal and one for business.  I need my phones not to sync otherwise they will both ring all the time.  How can I log out of my icloud and unsync my phones?

    Syncing your phones to the same iCloud account won't cause them to both ring all the time, it only puts the same contacts, calendars, and other synced data on the phone.  The phones will only ring with someone calls the number associated with the phone.
    If you want to stop using iCloud on one or both of the phones, go to Settings>iCloud, tap Delete Account, then choose Keep On My iPhone when prompted.  This will disconnect them from iCloud and keep a copy of the synced data on the phone.

  • How do i log out from my mail?

    how do i log out from my mail

    Cannot close and quit Mail?
    Force Quit?
    Press command + option + esc keys together at the same time.
    Wait.
    When Force Quit window appears, select Mail, if not already.
    Press Force Quit button at the bottom of the window.
    Wait.
    Application will quit.
    If this does not help, press the power button for 7 or more seconds.
    Computer will shut down.

  • User log in & log out time SAO

    Dear Experts,
    I hope every on fine.
    How to check the user log in & log out time daily & weekly in SAP.
    Thanks in advance
    Regards
    Dilip Pasila

    HI,
        You can see the details about user last logon & logoff by different ways.
    1)run the tcode suim->user ->By logon date and password Change->for all users logon details just enter(f8),again if you want a perticuler user's logon details just write down the name of the user & then execute.
    2)run the tcode se16->write table name usr02->execute you will able to see the users logon details.
    3)With the help of CCMS also You can see the last logon details
    rz20-> expand ccms monitor templates-> entire system->instance no->expand systen configuration->named user.

  • How can i log out?

    okay hay all my brother and I are on the same computer but different log in places we both have I tunes but every time I plug in my I pod it always says "Another user on this computer is using I tunes please ask them to log out yea well I wuz wondering because i donnu how to do tht how do i log out of his i tunes and onto mine i havent had songs on my i pod n over 2 mnths ive only had it for three n him for 2 thanx a bunch

    Amy, as BusyMe told you earlier you will have to turn off "fast user switching" in XP to be able to access your music. Your brother will have to log on to the computer & you will have to log off when you are done for both of you to get to your libraries. This can't be done with "fast user" turned on.

  • How do you log out?

    How do you log out of a forum? Is it at all possible?
    Seems I am logged in to any forum I go to if I switch between different ones, even ones I never previously used to be a member of. So am I now a member of all existing forums just because I logged in?
    I've actually been a member of several Adobe forums since 2002, but today they all consider me a new member who only joined today and gave me a screenname I  haven't used for quite some time. Not funny.

    Curt Wrigley wrote:
    Kath-H wrote:
    Chronological discussions are not confusing in the slightest. It couldn't be simpler to clarify what you are replying to if necessary.
    Actually, it could be a lot simpler.  The system could add who you are replying to automatically.
    But; if it isnt obvious to you; Im not going to be able to convince you.
    Curt, please listen to me. First off, pointing out that some new features do not seem to be an improvement doesn't put me in dinosaur territory.
    Second, even if we added an extra 'feature' of telling me who is being replied to, that doesn't tell me what they said. To know that I'd have to start jumping back and forth. If I don't even realise that an apparent non sequitur is because a person is replying to something a couple of pages back - because they are using threaded view - that's a recipe for confusion.
    Before, if we needed to reply to a post some way back, we'd swipe through the relevant text - as more than one post was visible when replying, another new annoyance - add a greater than symbol, paste and carry on.
    How do you think people will react if they've never been here before, have no clue about what threaded/flat views even are?
    I don't particularly like threaded view, partly because of the ever-shrinking width, but I'd live with it if everyone used it.
    If I insisted on living in the past I'd still be using Pagemaker or Quark and Pagemill - but you don't have to lose your critical faculties every time someone waves something new and shiny in front of your eyes.

  • HT1349 I give up!  How do I log out of Gmail on my ipad!?

    I do not want my Gmail to be open all the time on my iPad2.
    Please help, how can I "log out", "sign off" when I am finished?
    If I cannot log out of it, how do I protect it for privacy? 
    Thank you!

    I am afraid you can't log out of your email. The iPad is basically a single user device.
    You may want to setup your Passcode Lock.

  • I created a new Apple ID for iCloud on my iPhone, but I can't seem to find a way to "sign out" or "log out" of that Apple ID (for iCloud) to sign in with another Apple ID. The only account login I could change was the Store. How do I "log out"

    I created a new Apple ID for iCloud on my iPhone, but I can't seem to find a way to "sign out" or "log out" of that Apple ID (for iCloud) to sign in with another Apple ID. The only account login I could change was the Store.
    How do I "log out" or "sign out" of iCloud on my iPhone? There is an option to delete the account, but I just want to log off. I want to keep the account name for future use.

    @fernandamagalhaes
    It looks like the article below has the information you are looking for.
    iCloud: Change iCloud feature settings
    http://support.apple.com/kb/PH2613
    Turn off iCloud completely
    Depending on whether you want to stop using iCloud on all or only some devices, do one or more of the following:
    On your iOS device’s Home screen, go to Settings > iCloud, then at the bottom of the screen, tap Delete Account.
    Note:   If you delete your iCloud account, iCloud will no longer back up your iOS data. You can still back up your device in iTunes (for more information, open iTunes and choose iTunes > Help). 
    On your Mac, open iCloud preferences, then click Sign Out.
    If your Mac has OS X v10.7.5 and you turn off iCloud, your calendar information and reminders aren’t stored locally in iCal. If you want to retain your calendar and reminder information, you need to back it up before turning off iCloud. For more information, see the Apple Support article iCloud: Calendar & reminder data removed from Calendar and Reminders or iCal when disabling iCloud Calendar.
    On your Windows computer, open the iCloud Control Panel, then click Sign Out.
    Note:   If you turned on automatic download of music, app, or book purchases (in iTunes preferences or in Settings on your iOS device), your iTunes purchases are still downloaded to your devices.
    Set up iCloud on your devices

  • How can I log out of my Apple ID on my iphone 4 because I have the iphone 5 now?

    I bought an iphone 5 but still had the iphone 4. How can i log out of my apple id on the 4 so i can sell it without worrying about someone having access to my things?

    Jae Sinz wrote:
    ...How can i log out of my apple id on the 4...
    Settings > Store > Apple ID = Log out.
    Jae Sinz wrote:
    ...so i can sell it without worrying about someone having access to my things?
    ERASE / Clear All Data
    Go to Settings > General > Reset > Erase all content and settings

  • How do i log out of my itunes account to allow someone else to login and sync their iphone?, how do i log out of my itunes account to allow someone else to login and sync their iphone?

    how do i log out of my itunes account to allow someone else to login and sync their iphone?

    In mail app, you can remove the account and add theirs in settings>Mail, Calendars,Contacts.
    or add theirs only and in mail, go up a level and view each inbox seperately.
    The ipad is not designed for multi-user use however so it is not easy.

  • How can i log out from my social media from a distance because my iPod got stolen and i don't want anyone hacking my accounts

    how do i log out of my social media from a distance because my ipod got stolen and i dont want any one hacking in to my account??

    Change your password.

  • HT1694 How do I log out of my email account to allow someone else to log in

    How do I log out of my email account to allow someone else to log in

    In mail app, you can remove the account and add theirs in settings>Mail, Calendars,Contacts.
    or add theirs only and in mail, go up a level and view each inbox seperately.
    The ipad is not designed for multi-user use however so it is not easy.

  • HT4865 I just bought this ipad and cannot log out from icloud because i dont have the password.how can i log out from icloud?need help

    I just bought this ipad and cannot log out from icloud because i dont have the password.how can i log out from icloud?need help

    You need to return it to the seller and get your money back.  You cannot reset or use the device with another AppleID installed unless you know the password for that ID.
    If the device has been jailbroken, no one on here can give you any further help...the Terms of Use prohibit us from doing so.

  • How do I log out of my husbands account on iPhoto and log into mine?

    How do I log out of my partners iPhone account and then log into mine to put my art
    photos on Facebook

    The problem I'm having is logging out of the second box, below; 'Out going mail server' and also 'port' which has a number. Will it automatically fill with a new port number? Having changed to my e-mail address etc?

  • How can i log out of an account on my mail app on my computer

    how can i log out of an account on my mail app on my computer

    Mail > Preferences > Accounts > Account Information > Enable this account: uncheck

Maybe you are looking for