can someone fix my code ?
I will write my code down and all infomation you need .
1. Register a user with the system. The customer needs to provide name, address, phone#, email, password, and user type (host or guest or both). The procedure should check whether the email already exists in user table. If so, please print a message saying the customer exists. Otherwise create an account with input values and return a new user ID.
Summary: This feature will allow customers to add their details in the system. These details will be used to create account. Every customer will have an unique id which can be used to login.
Input : Name, Address, City, Zipcode, Phone Number, Email Id, Password
Output : If Email is already present in the system throw output message ‘The email is already registered’
If not, throw message ‘Email Id registered successfully’
Example : exec RegisterGuest (‘Sam Williams’,’10 Gorman road, ‘Baltimore’,’20712′,’
If ‘swilliams@gmail.com’ is present in the Guest table, then throw message ‘The email is already registered’ otherwise display Guest id ‘85768
_____________________
Create sequence userID_seq start with 100;
Create or replace function User_registration(name users.u_fname%type, address users.u_street%type, phone number, email users.u_email%type,
password users.u_pass%type, user_type users.u_g_type%type)
Return users.u_id%type
As
check_email users.u_email%type
x users.u_id%type;
Begin
Select u_email into check_email from Users where u_email = email;
If check_email is NOT NULL then
DBMS_output.put_line(‘This email is already registered’)
Else
insert into users(UserID_seq.nextval, name, address, phone, email,password , user_type );
Select userID_seq.currval into x from users;
dbms_output.put_line(x);
End if;
End;
———————–
Create table user(
u_id int,
u_fname varchar(20),
u_lname varchar(20),
u_g_type int,
u_h_type int,
u_pass varchar(8),
u_email varchar(30),
u_address varchar(30),
u_state varchar(2),
u_zip int,
u_city varchar(15),
primary key (u_id));
"You need a similar assignment done from scratch? Our qualified writers will help you with a guaranteed AI-free & plagiarism-free A+ quality paper, Confidentiality, Timely delivery & Livechat/phone Support.
Discount Code: CIPD30
Click ORDER NOW..


