Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

2011-11-2 Vernier and Pipeline function

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Http://www.itpub.net/thread-1499223-11-1.html

105 floor

I created this table and filled in the data:

CREATE TABLE plch_parts (partnum INTEGER PRIMARY KEY, partname VARCHAR2) UNIQUE) / BEGIN INSERT INTO plch_parts VALUES (1, 'Mouse'); INSERT INTO plch_parts VALUES (100,' Keyboard'); INSERT INTO plch_parts VALUES (500, 'Monitor'); COMMIT;END;/

I created the following nested table types and package descriptions:

CREATE OR REPLACE TYPE numbers_t IS TABLE OF NUMBER;/CREATE OR REPLACE PACKAGE plch_pipelineIS CURSOR refcur_c IS SELECT line FROM user_source; TYPE refcur_t IS REF CURSOR RETURN refcur_c%ROWTYPE; FUNCTION double_values (dataset refcur_t) RETURN numbers_t PIPELINED;END plch_pipeline;/

Which of the following options implements the package body so that after the query is executed:

SELECT * FROM TABLE (plch_pipeline.double_values (CURSOR (SELECT line FROM user_source WHERE name = 'PLCH_PIPELINE' AND type =' PACKAGE' AND line SELECT * 2 FROM TABLE) (plch_pipeline.double_values (3 CURSOR (SELECT line 4 FROM user_source 5 WHERE name = 'PLCH_PIPELINE' 6 AND type =' PACKAGE' 7 AND line SELECT * 2 FROM TABLE (plch_pipeline.double_values (3 CURSOR (SELECT line 4) FROM user_source 5 WHERE name = 'PLCH_PIPELINE' 6 AND type =' PACKAGE' 7 AND line SELECT * 2 FROM TABLE (plch_pipeline.double_values (3 CURSOR (SELECT line 4) FROM user_source 5 WHERE name = 'PLCH_PIPELINE' 6 AND type =' PACKAGE' 7 AND line SELECT * 2 FROM TABLE (plch_pipeline.double_values (3 CURSOR (SELECT line 4 FROM user_source 5) WHERE name = 'PLCH_PIPELINE' 6 AND type =' PACKAGE' 7 AND line

The answer is on the 109th floor.

2011-11-2 answer D.A: the function called in SQL cannot have DML, unless it is an autonomous transaction; B: although an autonomous transaction is used, it must be committed or rolled back before returning (PIPE ROW returns a row of data); C: although an autonomous transaction is used and there is COMMIT, but the position is wrong, COMMIT is placed outside the loop, so that it is not committed before returning (PIPE ROW).

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report