In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Http://www.itpub.net/thread-1499223-7-1.html
64 floor
I created this table and filled in the data:
CREATE TABLE plch_employees (employee_id INTEGER, last_name VARCHAR2, salary NUMBER) / BEGIN INSERT INTO plch_employees VALUES (100,' Ellison', 1000000); INSERT INTO plch_employees VALUES (200,' Gates', 1000000); INSERT INTO plch_employees VALUES (300,' Zuckerberg', 1000000); COMMIT;END;/
And then I wrote this block:
DECLARE C1 SYS_REFCURSOR; c2 SYS_REFCURSOR; l_id plch_employees.employee_id%TYPE;BEGIN OPEN C1 FOR SELECT employee_id FROM plch_employees ORDER BY last_name; / * FINISH*/EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.put_line ('ERROR'); END;/
Which of the following options can be used to replace the / * FINISH*/, above so that the block displays the following three lines after execution:
one hundred
two hundred
three hundred
(A)
FETCH C1 INTO ladders; c2: = c1 / fetch c2 INTO lputlines (l_id); CLOSE c1 / l_id / c2 / c2 / CLOSE / c2 / c2 / l_id / SQL > DECLARE 2 / c1 / c1 / c2 / SYS_REFCURSOR; 4 l_id plch_employees.employee_id%TYPE; 5 OPEN c1 / FOR 7 SELECT employee_id FROM plch_employees ORDER BY last_name / 5 8 9 FETCH C1 10 INTO ladders; 11 DBMS_OUTPUT.put_line (l_id); 12 13 c2: = C1; 14 15 FETCH c2 16 INTO ladders; 17 DBMS_OUTPUT.put_line (l_id); 18 19 CLOSE C1; 20 21 FETCH c2 22 INTO ladders; 23 DBMS_OUTPUT.put_line (l_id); 24 25 EXCEPTION 26 WHEN OTHERS THEN 27 DBMS_OUTPUT.put_line ('ERROR'); 28 END 29 / 100200ERRORPL/SQL procedure successfully completedSQL >
(B)
FETCH C1 INTO ladders SQL SQL > DECLARE 2 C1 SYS_REFCURSOR; 3 c2 SYS_REFCURSOR; 4 l_id plch_employees.employee_id%TYPE; 5 OPEN c1 FOR 7 SELECT employee_id FROM plch_employees ORDER BY last_name 5 OPEN c1 SYS_REFCURSOR; 3 c2 SYS_REFCURSOR; 4 l_id plch_employees.employee_id%TYPE; 5 OPEN c1 FOR 7 SELECT employee_id FROM plch_employees ORDER BY last_name 8 9 FETCH C1 10 INTO ladders; 11 DBMS_OUTPUT.put_line (l_id); 12 13 c2: = C1; 14 15 FETCH c2 16 INTO ladders; 17 DBMS_OUTPUT.put_line (l_id); 18 19 CLOSE c2; 20 21 FETCH C1 22 INTO ladders; 23 DBMS_OUTPUT.put_line (l_id); 24 25 EXCEPTION 26 WHEN OTHERS THEN 27 DBMS_OUTPUT.put_line ('ERROR'); 28 END 29 / 100200ERRORPL/SQL procedure successfully completedSQL >
(C)
FETCH C1 INTO lputtellate DBMSroomOUTPUT.putSecretline (l_id); c2: = c1x fetch c2 INTO lputSecretline (l_id); FETCH c1 INTO literidentDBMSroomOUTPUT.putSecretline (l_id); CLOSE c1missSQL > DECLARE 2 C1 SYS_REFCURSOR; 3 c2 SYS_REFCURSOR; 4 l_id plch_employees.employee_id%TYPE; 5 BEGIN 6 OPEN c1 FOR 7 SELECT employee_id FROM plch_employees ORDER BY last_name 8 9 FETCH C1 10 INTO ladders; 11 DBMS_OUTPUT.put_line (l_id); 12 13 c2: = C1; 14 15 FETCH c2 16 INTO ladders; 17 DBMS_OUTPUT.put_line (l_id); 18 19 FETCH C1 20 INTO ladders; 21 DBMS_OUTPUT.put_line (l_id); 22 23 CLOSE c1; 24 CLOSE c2 25 26 EXCEPTION 27 WHEN OTHERS THEN 28 DBMS_OUTPUT.put_line ('ERROR'); 29 END; 30 / 100200300ERRORPL/SQL procedure successfully completedSQL >
(D)
FETCH C1 INTO ladders: CLOSE c1 DECLARE c2 INTO 1 SYS_REFCURSOR; 4 l_id plch_employees.employee_id%TYPE; 5 OPEN c1 FOR 7 SELECT employee_id FROM plch_employees ORDER BY last_name 5 OPEN c1 FOR 7 SELECT employee_id FROM plch_employees ORDER BY last_name 8 9 FETCH C1 10 INTO ladders; 11 DBMS_OUTPUT.put_line (l_id); 12 13 c2: = C1; 14 15 FETCH c2 16 INTO ladders; 17 DBMS_OUTPUT.put_line (l_id); 18 19 FETCH C1 20 INTO ladders; 21 DBMS_OUTPUT.put_line (l_id); 22 23 CLOSE C1; 24 25 EXCEPTION 26 WHEN OTHERS THEN 27 DBMS_OUTPUT.put_line ('ERROR'); 28 END 29 / 100200300PL/SQL procedure successfully completedSQL >
Answer D
The answer is on the 65th floor
2011-10-19 answer: d (A) the result of this option is: 100200ERROR this is because after I turn off C1, C2 will also be closed, so the third FETCH will throw a "ORA-01001: invalid cursor" exception. (B) Ibid, as long as one of C1J C2 is closed, the other is closed accordingly. (C) the result of this option is: 100200300ERROR since I did not close the cursor before the end of the three FETCH, I can see 100300. But then I shut down C1 and tried to shut down C2. Once C1 is turned off, C2 is automatically shut down, so if you try to shut down C2 again, you will report a "ORA-01001: invalid cursor" error. (d) correct
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.