Multiple choice technology databases

create or replace procedure "test" as a_string varchar(1000 char) := NULL; b_string varchar(2000 char) := NULL; fullname VARCHAR(200 char); edate VARCHAR(200 char); SG VARCHAR(1000 char); cursor c_username is select userid, username from knta_users where username like 'D%'; Begin open c_username; for i in c_username loop a_string := ''; a_string := a_string || ' ' ||i.userid; select full_name into fullname from knta_users where username = i.username ; a_string := a_string || ' ' ||fullname; DBMS_OUTPUT.PUT_LINE( ' ' ||a_string ); END LOOP; close c_username; end "test"; Examine the procedure and choose what will happen when this procedure is executed:

  1. This procedure will not compile successfully.

  2. This procedure will print the Userid and fullname of users whose username starts with ‘D’;

  3. This procedure will print just the fullname of the users.

  4. This procedure will print just the userid of the users.

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The procedure declares a cursor for usernames starting with 'D', then uses a FOR loop to iterate through it. Inside the loop, it concatenates userid and fullname into a_string and prints it. This compiles and runs successfully, printing both userid and fullname.