Question: 1. Consider the following code: DECLARE a number; b number; c number; BEGIN a:= 23; b:= 45; findMin(a, b, c); dbms_output.put_line(' Minimum of (23, 45)
1. Consider the following code: DECLARE a number; b number; c number; BEGIN a:= 23; b:= 45; findMin(a, b, c); dbms_output.put_line(' Minimum of (23, 45) : ' || c); END; Write the following procedure: PROCEDURE findMin(x IN number, y IN number, z OUT number) 2. Consider the following code: DECLARE a number; BEGIN a:= 23; squareNum(a); dbms_output.put_line(' Square of (23): ' || a); END; Write the procedure squareNum. CREATE TABLE DBUSER ( USER_ID NUMBER (5) NOT NULL, USERNAME VARCHAR2 (20) NOT NULL, AGE NUMBER(3) NOT NULL, STATE VARCHAR2(20), PRIMARY KEY ( USER_ID ) ) Write the following procedures: 3. Add a new user: CREATE OR REPLACE PROCEDURE add_DBUSER(p_userid IN DBUSER.USER_ID%TYPE, p_username IN DBUSER.USERNAME%TYPE, p_age IN DBUSER.AGE%TYPE, p_state IN DBUSER.STATE%TYPE) 4. Delete an existing user: CREATE OR REPLACE PROCEDURE delete_DBUSER(p_userid IN DBUSER.USER_ID%TYPE) 5. Search for a username based on user id: (Hint: Use Implicit Cursor) CREATE OR REPLACE PROCEDURE search_DBUSER(p_userid IN DBUSER.USER_ID%TYPE) 6. List usernames based on a given state: (Hint: Use Explicit Cursor) CREATE OR REPLACE PROCEDURE list_DBUSERS(p_userid IN DBUSER.STATE%TYPE)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
