- For individual users
- Instant access to solutions
- Ask your tech questions
- Start your 30-day Free Trial
Main Topics
Browse All TopicsThis question has to do with pl/sql. i had a different answer for this question than the one supposed to be true. I wanna know why I'm wrong:
--------------------------
Examin this code:
CREATE OR REPLACE PROCEDURE insert_dept (p_location_id NUMBER)
IS
v_dept_id NUMBER(4);
BEGIN
INSERT INTO departments
VALUES (5, 'Education', 150, p_location_id);
SELECT department_id
INTO v_dept_id
FROM employees
WHERE employee_id = 99999;
END insert_dept;
/
CREATE OR REPLACE PROCEDURE insert_location (p_location_id NUMBER, p_city VARCHAR2)
IS
BEGIN
INSERT INTO locatoins( location_id, city)
VALUES (p_location_id, p_city);
insert_dept( p_location_id );
END insert_location;
/
You just created the departments, the locations, and the employees table. You did not insert any rows. Next you created both procedures.
You now invoke insert_location procedure using the following command:
EXECUTE insert_location(19, 'San Francisco')
What is the result in this EXECUTE command?
A. The locations, departments and employees tables are empty.
B. The departments table has one row.
The locations and the employees tables are empty.
C. The location table has one row.
The departments and the employees table are empty.
D. The locations table and the departments table both have one row.
The employees table is empty.
Answer: A
--------------------------
Why A?! isn't supposed to be D. Please explain.
p.s, i assure you i have made no mistake in copying the question text. So there are no typos.
This question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership