Below is the code for a procedure that will accept a Customer ID as an input parameter and display the Customer ID, Customer Surname and Customer Address.
Review the code, then answer the questions that follow.
create or replace procedure sp_customer_details (c_id IN CUSTOMER.cust_id%TYPE,customer_details out VARCHAR2)ISBEGINSELECT 'CUSTOMER ID:' || c.cust_id || ', Surname:'|| c.cust_sname || ',ADDRESS:' ||c.cust_addressinto customer_detailsfrom CUSTOMER cwhere c.cust_id = c_id;END;
Q.1 Briefly discuss the advantages of using the %TYPE attribute in the code.
Q.2 Create the code to execute the procedure with exception handling if no customer data is found. Use customer ID C115 in your code.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here