Get the App
SLTechnology News&Howtos  ›  Database  › 

2011-11-2 Vernier and Pipeline function

Shulou Source: shulou.com Published: 2022-06-01 06:20:33 09月21日 Update

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).

Tags: Transaction autonomy data answer function no one line location that is type D.A three lines loop query cursor pipe Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple OPPO Reno Shulou Information Xiaomi Microsoft