How to check username password is valid?

I write the following code in "WHEN-BUTTON-PRESSED" trigger... Is this good code?

declare
username varchar2 (40);
PSW varchar2 (40);
uidd varchar2 (40);
pass varchar2 (40);

cursor log_cur is
Select emp_id, emp_name, password
of emp_details
where emp_id = userid;

Start
UserID: =: ID;
PSW: =: PASSWORD;
Open log_cur;
extract log_cur in uidd, pass;
If the user name is null then
message ("' enter valid username");
end if;
If psw is null then
message ('Enter valid password');
end if;

if(log_cur%NotFound) then
message ("name of invalid user or password");
elsif (userid = uidd and psw = pass) then
message ('Welcome');
end if;

Hello

First U must not use a cursor, explicit...!

You can use only the statements select anyway, you can use...

Declare

   user_id           VARCHAR2(40);
   pass_word       VARCHAR2(40);

CURSOR log_cur is
SELECT emp_id,password
FROM  emp_details
WHERE emp_id=  user_id ;

BEGIN

 user_id           :=:ID;
pass_word       :=:PASSWORD;

OPEN log_cur;

-----====---------------------Null Values Validation-----------------------------====---

FETCH log_cur INTO user_id           , pass_word ;

IF user_id   IS NULL THEN

    MESSAGE('pls Enter the user id ');

    SYNCHRONIZE; -- TO WORKS AS AN aLERT

END IF;

IF pass_word  IS NULL THEN

MESSAGE (pls Enter the pass word');

 SYNCHRONIZE; -- TO WORKS AS AN aLERT

END IF;

-----====---------------------Invalid Values Validation-----------------------------====---

IF (log_cur%NOTFOUND)THEN

MESSAGE ('Invalid Data Pls Check ur user id or Password');

 SYNCHRONIZE;

ELSIF (user_id  =emp_id ) THEN 

MESSAGE ('Valid User Pls Enter ur Pass Word');
SYNCHRONIZE;

ELSIF ( pass_word = password )then

MESSAGE ('Valid PassWord Entery, Welcome to Your Application (or) Hello ' || user_id );
SYNCHRONIZE;

end if;

CLOSE log_cur ;
 

u sew validate the values NULL and invalid values in a separate normal select statements

But am glad you are trying to write your own code and I'm trying to help you improve I can...!

am sure there are better development; But it's a start, we try to step with a not to write your own code...

Good job Battistelli :)

Hope this helps u...

Kind regards

Abdetu...

Tags: Oracle Development

Similar Questions

  • How to check for the date validation

    Hello

    I have 3 validation of date in order.

    10 - P1_FROM - (type - Item specified is a valid date)
    20 - P1_TO - (type - Item specified is a valid date)

    30 compare dates P1_FROM & P1_TO
    I want to run it only when these 2 dates are field not null not and registered as valid a date.
    HOW to set that State...
    Type - Function returning bollean
    
    Validation Expression1 - 
    if TO_DATE(:P1_TO,'MM/DD/YYYY') <= TO_DATE(:P1FROM,'MM/DD/YYYY') then
         return false;
    else
         return true;
    end if;
    
    Condition- PL\SQL Expression // I want to put a condition here NOT NULL as well as VALID date
    :P1_FROM is not null AND
    :P1_TO is not null
    Thank you
    Deepak

    Try an exception handler. for example

    begin
    if :P1_TO is not null and :P1FROM is not null then
      if TO_DATE(:P1_TO,'MM/DD/YYYY') <= TO_DATE(:P1FROM,'MM/DD/YYYY') then
        RETURN 'From date cannot be after the To date';
      end if;
    else
      if :P1_TO is null and :P1FROM is  null then
        null;
      else
        RETURN 'Both To and From values must be specified';
      end if;
    end if;
    EXCEPTION WHEN OTHERS THEN
      RETURN 'Invalid Date';
    end;
    
  • [nQSError: 43126] Failed authentication: username/password invalid, how to avoid?

    Hello

    I met following error: [nQSError: 43126] failed authentication: username/password invalid.
    When I started weblogic server and server used in the judgment.

    After poking around on the net, came across this blog: http://obiee11gqna.blogspot.com/2011/09/obiee-11g-errors-nqserror-43113.html

    Find password for MDS & BIPLATFORM has 'expired', managed to solve my problem and my presentation Services have been up & running.

    My question is, how to avoid the password SDM & BIPLATFORM to have expired in the future?

    Kind regards
    Jitendra

    Hi Jitendra,

    Check it out, http://www.artofbi.com/index.php/2011/03/oracle-11g-rdbms-password-expiration-default-possible-impact-on-obi-11g/

    Rgds,
    DpKa

  • How to cancel name for username/password when you access the WIn7 computer to stream?

    Hello

    I have a win7 computer and I would like to access it from a stream. I see the computer win 7 banners, but when I try to connect to access shared folders, it requires username & password. I don't know what they are. I have another computer with Vista from where I can access the computer of win 7. I can also access files on the computer of vista of banners.
    I turned on the discovery network, printer and file sharing, turn on sharing so anyone can read & write files in the public folder. Disabled password protection sharing and allowed Windows to manage the homegroup connections (recommended).
    Can any suggestions on how I disable the name of user and password? or at least what is it?
    Thank you
    Leon.
    PS: He used to work properly without a username, but suddenly he began to pose for her (probably after that I restarted the computer or the streamed)

    Hello

    I understand that you want to cancel the name for username/password when you access the WIn7 computer to stream.

    I suggest you to send your query on the forum of streamer and I hope that they will be able to guide you in the right direction.

    Here is the link:

    http://support-splashtop2.Splashtop.com/forums

    It will be useful. For any other corresponding Windows help, do not hesitate to contact us and we will be happy to help you.

    Kind regards!

  • Validity fingerprint sensor - how to replace working password by fingerprint? TP E-431

    Validity fingerprint sensor - how to replace working password by fingerprint?

    HOW can I do this? is it posible?

    New Manager of fingerprints for thinkpads with VALIDITY player has only the possibilities of schooling fingerpint
    a cant find any optio to use fingerprints instead of turning on the password or HARD drive password

    ThinkPad e431

    Hi hroshi, welcome to the forums.

    Sorry, I know this isn't what you want to read, unfortunately it is not taken in charge on aircraft systems

    http://forums.Lenovo.com/T5/ThinkPad-edge-S-series/power-on-password-via-fingerprint-reader/m-p/4562...

  • How to check the RegEx validation

    Hello

    My application needs to users to enter the regex. My question is how I can check the validation of the regular expression that users enter. The RegExp class does not provide any methods to check the regular expression validation.

    Kind regards

    Haibin

    You need to hand roll your own validator, unless someone knows of who is there. Flex does not validate the RegEx.

    If this post answers your question or assistance, please mark it as such.

  • zero or change username & password for a connection to another computer on the local network?

    When you open the network, and see you computers and or network for the Working Group action, well, I entered accidentally the wrong username / password for the computer, and I can't seem to change the username-password and or reset it.

    On the local network, I have a linux machine using samba, all permissions are correct, since the box vista * can * connect just fine and have access to everything which, however, on the vista box, I checked still remember the name of user and password, and now I can't change it on another account, I need to take it.

    I have searched for hours and I can't seem to find the answer.

    I tried to disable the account on the linux side and this does not, however, so, he says: "access denied", with no way to enter a new username / password!

    Anyone has an idea on how to solve this problem?

    Finally found the answer.

    In the cmd prompt, (Administrator rights), making control userpasswords2, and then tap the Advanced tab and finally, the button manage passwords.

  • How to check a bad use of vSphere or vCenter license details

    How to check if my license has been misused by someone or someone... If possible then how to check and stop the abuse...

    correct, it is there no 'validation' when the license is added to your inventory.  There isn't really anything you can do, I'm aware, other than to change your password in your portal of licenses.

  • How to check if the discoverer is installed in the oracle application server?

    Hello

    I'm a developer, and I had an obligation to prepare a few reports of discoverer.

    However, I am new to Discoverer and as a result, I am facing problems during indexing of discoverer as Oracle Applications users.

    When I give the credentials, it asks me to choose a responsibility, and then he throws me error like "invalid username/password".

    applied patches according to metalink notes.

    but before that, I would like to know if I can really see whether or not the discoverer has been installed on the server of Oracle Applications.

    As my DBA also ignorant of the installation of discoverer, he also could not help me in this.

    How can we check if the discoverer has been installed on the server side and if not, how do install us it?

    Sorry for the stupid question.

    Hello

    The owner EUL is APPS and I might be able to connect to the Admin with this database user.

    I think you have an installation of database in mode EUL. You may not use APPS as the owner of the END user license. Therefore, you need to create a new mode of EUL requests in a separate schema.

    Is it possible that we can connect to Disco Admin/Desktop tool as a user of the database even though Disco is not installed on the server of Oracle Applications

    Yes, no problem. You only need server discoverer of applications if you want to use more or spectator.

    Rod West

  • How to check the JVM system property settings

    Is there anyway to check the settings of JVM system properties in the weblogic runtime?

    If so, I would like to know how to do this WLST and weblogic console/EM.

    Thank you

    Hello

    We can get the JVM properties using the WLST, do the following

    (1) Goto {Weblogic-home}/wlserver_10.3/common/bin, run the wlst.sh script

    #sh wlst.sh

    2) connect to the managed server sought for which you are searching JVM properties

    WLS: offline > connect ('username', 'password','t3: / /:')

    (3) then run the command serverRuntime()

    WLS:/domain_name/ServerConfig>ServerRuntime()

    (4) then use the command ls()

    (5) and then run the following in order

    WLS: / domain_name/ServerRuntime > CD ('JVMRuntime')
    WLS: / domain_name/serverRuntime/JVMRuntime > cd ("the Desird server name '")
    WLS: / domain_name/serverRuntime/JVMRuntime/desired server name > ls)

    It will show the FMV of your server of your choice properties

    Concerning
    Delphine

    Published by: Alex on January 27, 2011 22:46

    Published by: Alex on January 27, 2011 23:28

  • How to check if statspack is installed?

    Hi all

    How to check if the statspack is already installed or not... ?

    Hello

    to generate a statspack you need one perfstat user, just check

    Select username from dba_users
    where username = 'PERFSTAT % % ';

    If the user exists, then you can create the snap and generate the statspack report, if the user is not that you need to create one with script

    spcreate. SQL

    Located on ORACLE_HOME/rdbms/admin/spcreate.sql, when you run this script, it will ask to tablespace and password, then connect to the perfstat user and run snaps and you're done... then run spreport.sql to generate the statspack report

    Thanks and greetings
    VD

    Published by: vikrant dixit on August 11, 2009 22:26

    Published by: vikrant dixit on August 11, 2009 22:29

  • Name of ADI 7.2 username/password error

    Hi all;

    ADI my version is: ADI 7.2 (patch 3966101 ) and then I applied ADI ROLLUP PATCH 7.2 .8 (patch 5580549 ) and I can connect with my TEST user one instance. But I can not connect another LIVE case which is locate another city. When I try to identify its give me name of username/password error invalid.

    I searched and I found ADI ROLLUP PATCH 7.2 .9 (patch 5906728 ) and I applied on my machine local too...

    Error in keeping... I did some research here and my host file and dbc file ID is same as:

    APPL_SERVER_ID = 5D108310AD5F2609E040640A28034A7442936734222968272392935559181921

    and the result of select server_id of FND_NODES is the same as the high side ID.

    I can run tnsping to the server and its working properly. By the way, I have remove sqlnet.ora of praying/net80/admin and C:\orant\NETWORK\ADMIN

    Anyone has idea why I can't connect to the system and name of user and password error invalid.

    Thank you

    HELIOS

    Thanks Helios.

    Have you checked the following notes?

    Note: 743465.1 - ADI 7.1.35/7.2 11.5.10 unable to connect to the database error
    https://metalink2.Oracle.com/MetaLink/PLSQL/ml2_documents.showDocument?p_database_id=not&P_ID=743465.1

    Note: How 335573.1 - ADI execution Assistant diagnosis
    https://metalink2.Oracle.com/MetaLink/PLSQL/ml2_documents.showDocument?p_database_id=not&P_ID=335573.1

  • The sound of Apple received email saying and tells me to check the password within 48 hours.  Scam?

    rreceived 'Apple' email, telling me to check the password within 48 hours.    Is it a scam?

    Yes, it's almost certainly a scam.

    The only time where Apple will send you a letter about your password is if you click on the "Forgot password" link on one of their sites, and even in this case the email will tell you how change or reset, has not check.

  • Hi, I answered no to the question on the registration of password for a spesific site. I changed my mind and would like Firefox to save the password. How to re-enable password for a spesific site saver?

    Hi, I answered no to the question on the registration of password for a spesific site. I changed my mind and would like Firefox to save the password. How to re-enable password for a spesific site saver?

    Check the list of exceptions to your Firefox password manager and check if your site is there or not?

  • How to remove the password of Bios on Tecra M9 PTM90E

    So I need help for my laptop.
    If I forgot my password and I want to remove my bios password

    Help, please.

    Hello, Konan

    On this forum, we discussed several times on the BIOS password.
    Anyway, as you can see BIOS password is very important for the security of the laptop and access to the data stored on the laptop. BIOS password removal is a kind of very secret and may not be posted in public forums like this.

    Many laptops in the world are stolen and blocked by BIOS password. It's easy to check some forums like this one and read how to remove BIOS password and unlock the mobile.
    I hope you understand what I mean. Please contact the nearest authorized maintainer and let them remove BIOS password for you.

    Good bye

Maybe you are looking for