This discussion is archived
1 2 3 Previous Next 42 Replies Latest reply: Feb 22, 2013 5:07 PM by 992059 Go to original post RSS
  • 15. Re: Login Screen in Oracle forms builder 6i
    Warren Tolentino Expert
    Currently Being Moderated
    try this in your when button press trigger.
    MESSAGE('PASSWORD.TI_USER_ID '||:PASSWORD.TI_USER_ID);
    MESSAGE('PASSWORD.TI_PASSWORD '||:PASSWORD.TI_PASSWORD);
    BEGIN
      SELECT USER_ID
        INTO :GLOBAL.USER_ID
        FROM PASSWORD
       WHERE USER_ID = :PASSWORD.TI_USER_ID
         AND PASSWORD= :PASSWORD.TI_PASSWORD;
       GO_BLOCK('PASSWORD');
    EXCEPTION
      WHEN NO_DATA_FOUND THEN
        MESSAGE('invalid login info');
    END;
  • 16. Re: Login Screen in Oracle forms builder 6i
    992059 Newbie
    Currently Being Moderated
    when i enter user id : 1 and password 1010 it first gives an error PASSWORD.TI_USER_ID 1 when i press ok it gives another one PASSWORD.TI_PASSWORD 1010 and after that invalid login info message appears in the bottom left corner

    i double checked sql plus to make sure there is a user 1 with password 1010 in the database and it is there

    Edited by: 989056 on 22-Feb-2013 10:33

    Edited by: 989056 on 22-Feb-2013 10:34
  • 17. Re: Login Screen in Oracle forms builder 6i
    Warren Tolentino Expert
    Currently Being Moderated
    989056 wrote:
    when i enter user id : 1 and password 1010 it first gives an error PASSWORD.TI_USER_ID 1 when i press ok it gives another one PASSWORD.TI_PASSWORD 1010 and after that invalid login info message appears in the bottom left corner
    acutally that is not an error that is what the message returns of the value you entered for those items. try this.
    MESSAGE('database '||sys_context('USERENV','DB_UNIQUE_NAME'));
    MESSAGE('PASSWORD.TI_USER_ID '||:PASSWORD.TI_USER_ID);
    MESSAGE('PASSWORD.TI_PASSWORD '||:PASSWORD.TI_PASSWORD);
    BEGIN
      SELECT USER_ID
        INTO :GLOBAL.USER_ID
        FROM PASSWORD
       WHERE USER_ID = :PASSWORD.TI_USER_ID
         AND PASSWORD= :PASSWORD.TI_PASSWORD;
       GO_BLOCK('PASSWORD');
    EXCEPTION
      WHEN NO_DATA_FOUND THEN
        MESSAGE('invalid login info');
    END;
    and this in SQL*Plus:
    select sys_context('USERENV','DB_UNIQUE_NAME') dbname from dual;
      SELECT USER_ID
        FROM PASSWORD
       WHERE USER_ID = 1
         AND PASSWORD= 1010;
    and post the results for both of them.
  • 18. Re: Login Screen in Oracle forms builder 6i
    992059 Newbie
    Currently Being Moderated
    The sql one comes up with the same row again

    SQL> select sys_context('USERENV','DB_UNIQUE_NAME') dbname from dual;

    DBNAME
    -----------------------------------------------------------------------
    STUD

    SQL> SELECT USER_ID
    2 FROM PASSWORD
    3 WHERE USER_ID = 1
    4 AND PASSWORD= 1010;

    USER_ID
    ----------
    1



    When i try to compile the button in forms builder it says identifier 'sys_context' must be declared
    statement ignored

    Edited by: 989056 on 22-Feb-2013 10:59
  • 19. Re: Login Screen in Oracle forms builder 6i
    Warren Tolentino Expert
    Currently Being Moderated
    select sys_context('USERENV','DB_UNIQUE_NAME') dbname from dual;
    what did you get when you tried to execute the above in SQL*Plus?
  • 20. Re: Login Screen in Oracle forms builder 6i
    992059 Newbie
    Currently Being Moderated
    DBNAME
    --------------------------------------------------------------------------------
    STUD
  • 21. Re: Login Screen in Oracle forms builder 6i
    Warren Tolentino Expert
    Currently Being Moderated
    try this on your form.
    SELECT name into :global.dbname FROM V$DATABASE;
    MESSAGE('global.dbname '||:global.dbname);
    MESSAGE('PASSWORD.TI_USER_ID '||:PASSWORD.TI_USER_ID);
    MESSAGE('PASSWORD.TI_PASSWORD '||:PASSWORD.TI_PASSWORD);
    BEGIN
      SELECT USER_ID
        INTO :GLOBAL.USER_ID
        FROM PASSWORD
       WHERE USER_ID = :PASSWORD.TI_USER_ID
         AND PASSWORD= :PASSWORD.TI_PASSWORD;
       GO_BLOCK('PASSWORD');
    EXCEPTION
      WHEN NO_DATA_FOUND THEN
        MESSAGE('invalid login info');
    END;
  • 22. Re: Login Screen in Oracle forms builder 6i
    992059 Newbie
    Currently Being Moderated
    identifier V$DATABASE must be declared
  • 23. Re: Login Screen in Oracle forms builder 6i
    Warren Tolentino Expert
    Currently Being Moderated
    what is the database you are login at on your form? click on the file menu and select connect.
  • 24. Re: Login Screen in Oracle forms builder 6i
    992059 Newbie
    Currently Being Moderated
    username ins2014_104
    database STUD
  • 25. Re: Login Screen in Oracle forms builder 6i
    Warren Tolentino Expert
    Currently Being Moderated
    ok they are in the same database. try this in the form to see if that will return the global.user_id.
    MESSAGE('PASSWORD.TI_USER_ID '||:PASSWORD.TI_USER_ID);
    MESSAGE('PASSWORD.TI_PASSWORD '||:PASSWORD.TI_PASSWORD);
    BEGIN
      SELECT USER_ID
        INTO :GLOBAL.USER_ID
        FROM PASSWORD
       WHERE USER_ID = :PASSWORD.TI_USER_ID
         AND PASSWORD= :PASSWORD.TI_PASSWORD;
    MESSAGE('GLOBAL.USER_ID '||:GLOBAL.USER_ID);
       GO_BLOCK('PASSWORD');
    EXCEPTION
      WHEN NO_DATA_FOUND THEN
        MESSAGE('invalid login info');
    END;
  • 26. Re: Login Screen in Oracle forms builder 6i
    992059 Newbie
    Currently Being Moderated
    it compiles succesfuly than when i press the button it gives me the values i just entered as errors and after that invalid login info message in the bottom left corner

    Edited by: 989056 on 22-Feb-2013 11:38
  • 27. Re: Login Screen in Oracle forms builder 6i
    Warren Tolentino Expert
    Currently Being Moderated
    check that your block item :PASSWORD.TI_USER_ID property is a data type of number. if not change it to number. then try this:
    MESSAGE('PASSWORD.TI_USER_ID '||:PASSWORD.TI_USER_ID);
    MESSAGE('PASSWORD.TI_PASSWORD '||:PASSWORD.TI_PASSWORD);
    BEGIN
      SELECT USER_ID
        INTO :GLOBAL.USER_ID
        FROM PASSWORD
       WHERE USER_ID  = :PASSWORD.TI_USER_ID
         AND trim(PASSWORD) = trim(:PASSWORD.TI_PASSWORD);
    MESSAGE('GLOBAL.USER_ID '||:GLOBAL.USER_ID);
       GO_BLOCK('PASSWORD');
    EXCEPTION
      WHEN NO_DATA_FOUND THEN
        MESSAGE('invalid login info');
    END;
    notice that column password and block item is wrap with the function TRIM() that is to remove excess white space if there is any.
  • 28. Re: Login Screen in Oracle forms builder 6i
    992059 Newbie
    Currently Being Moderated
    should it be database item or not ? mine is set to database item - yes. Datatype was set to char i changed it to number but now it says identifier TRIM must be declared.

    Edited by: 989056 on Feb 22, 2013 7:50 PM
  • 29. Re: Login Screen in Oracle forms builder 6i
    Warren Tolentino Expert
    Currently Being Moderated
    not sure why TRIM is not working your forms builder 6i. if it does not work try this:
         AND ltrim(rtrim(PASSWORD)) = ltrim(rtrim(:PASSWORD.TI_PASSWORD));

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points