Results 1 to 4 of 4

Thread: Need Help..

  1. #1
    Join Date
    Jun 2007
    Posts
    35

    Unanswered: Need Help..

    hi
    i need help in this stuff..i develop a system using oracle forms builder 10g. In my system i have a login page.what i'm trying to do is everytime user click login the user get some point but only once in a day. how to compare date today and date user login and update the point. column point is in user table column curr_point.
    I'm trying but cannot update....
    this code is in login button...

    declare
    username1 varchar(10);
    pwd1 varchar(10);
    lgdate date;
    btn number;
    begin
    select sysdate into lgdate from dual ;
    select username,pwd,logindate into username1,pwd1,lgdate from gs where username=:txtloguser;
    :global.loguser:=:txtloguser;


    if pwd1=:txtlogpass then
    update gs set curr_point=curr_point + 50 where username=:txtloguser;
    call_form('C:\GS\userprofile.fmx');
    end if;

    please help...anybody..
    **akuccputsedut**
    Intelligent is Me!!But a little confusing
    sometimes needs HELP!!

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    So, what is the problem? CURR_POINT is not updated? If so, did you COMMIT?

    Or, is it the fact that - if the same user logins several times "today" - CURR_POINT is updated several times "today"? If so, you'll have to alter that table and add a column which will contain the LAST_UPDATE_DATE so - if user logins for the second time today and LAST_UPDATE_DATE = SYSDATE (don't forget to truncate both!), don't update the CURR_POINT column.

  3. #3
    Join Date
    Jun 2007
    Posts
    35
    thank's littlefoot for ur help....actually my problem is the update is running but when i'm try to compare the date the update is not work...so how to compare the date...??maybe something wrong with my code... I'm understand what ur try to explain about last update date...i'll try to do it...but after compare the my update_point cannot work...
    **akuccputsedut**
    Intelligent is Me!!But a little confusing
    sometimes needs HELP!!

  4. #4
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    DATE datatype contains both date and time. That's why I have said
    Quote Originally Posted by LF
    don't forget to truncate both!
    Because, if you don't truncate time portion, you probably won't get any result.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •