Click here to Skip to main content
15,885,365 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm trying to write a procedure to login into a system by counting the number of selected rows but it keeps outputting 1.

What I have tried:

create or replace PROCEDURE Login
(email in VARCHAR2, passwordd in VARCHAR2, counter out number)
is
begin

select count(customer_email)into counter
from customer 
where customer.customer_email = email and customer.passwordd = passwordd;

end;
Posted
Updated 19-Apr-19 19:53pm

That looks like exactly what you are asking it to do. Unless you have multiple customers with the same email address all using the same password. i.e. Duplicates.
 
Share this answer
 
Don't do it like that. Never store passwords in clear text - it is a major security risk. There is some information on how to do it here: Password Storage: How to do it.[^]
And remember: if this is web based and you have any European Union users then GDPR applies and that means you need to handle passwords as sensitive data and stored them in a safe and secure manner. Text is neither of those and the fines can be .... um ... outstanding. In December a German company received a relatively low fine of €20,000 for just that.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900