What exactly is parallelised in pipelined functions?

Hi All,
I have a slight confusion about pipelined table functions, which are parallelised (with PARALLEL_ENABLE clause).
Everywhere on the internet/documents it is mentioned that, we can use PARALLEL_ENABLE with pipelined table functions, I am not clear about exactly how this will work?
For example, I have a pipelines function, which is called by C# code to write data in file ( Oracle v11.2 on Linux 64bit). Function looks something like
FUNCTION extract_data (param1..., param2...., param3.... )
RETURN data_tab  /* this data_tab is table of record type data_rec */
PIPELINED
IS
     v_data_rec      data_rec := data_rec ( null, null,....., null);
BEGIN
  FOR i_rec IN ( select col1, col2, col3,.... FROM table1, table2 WHERE <all typical stuff here> )
  LOOP
          v_data_rec.col1 := i_rec.col1 ;
          v_data_rec.col2 := i_rec.col2 ;
          v_data_rec.col3 := i_rec.col3 ;
          if v_data_rec.col1 = 'A' then
              select col into v_data_rec.col4 from tablex where .... ;
          elsif v_data_rec.col1 = 'B' then
              select col into v_data_rec.col4 from tabley where .... ;
          elsif v_data_rec.col1 = 'C' then
              select col into v_data_rec.col4 from tablez where .... ;
          elsif v_data_rec.col1 = 'D' then
              select col into v_data_rec.col4 from tablet where .... ;
          end if ;
          /* some more bits of complex logic here */
          PIPE ROW ( v_data_rec ) ;
  END LOOP ;
END extract_data ;Now, if I add PARALLEL_ENABLE to my function definition, which bits will be parallelised? will anything be parallelised ?
Thoughts please.
Thanks in advance.

i.e. this ( where the query might well be run in parallel, but the result processed serially by the pipelined function):
SQL> explain plan for
  2  select *
  3  from   table(
  4         f_serial_pipe
  5         (cursor(select /*+ parallel (t1 4) */
  6                        *
  7                 from   t1)));
Explained.
SQL>
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
Plan hash value: 1425181138
| Id  | Operation                          | Name          | Rows  | Bytes | Cost (%CPU)| Time     |
|   0 | SELECT STATEMENT                   |               |  8168 |  1100K|    34   (3)| 00:00:01 |
|   1 |  VIEW                              |               |  8168 |  1100K|    34   (3)| 00:00:01 |
|   2 |   COLLECTION ITERATOR PICKLER FETCH| F_SERIAL_PIPE |  8168 |       |    34   (3)| 00:00:01 |
Note
   - dynamic sampling used for this statement (level=4)
13 rows selected.
SQL> is different from thsi:
SQL> explain plan for
  2  select *
  3  from   table(
  4         f_parallel_pipe
  5         (cursor(select /*+ parallel (t1 4) */
  6                        *
  7                 from   t1)));
Explained.
SQL>
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
Plan hash value: 2029647211
| Id  | Operation                            | Name            | Rows  | Bytes | Cost (%CPU)| Time     |    TQ  |IN-OUT| PQ Distrib |
|   0 | SELECT STATEMENT                     |                 |  8168 |  1100K|    34   (3)| 00:00:01 |        |      |            |
|   1 |  PX COORDINATOR                      |                 |       |       |            |          |        |      |            |
|   2 |   PX SEND QC (RANDOM)                | :TQ10000        |  8168 |  1100K|    34   (3)| 00:00:01 |  Q1,00 | P->S | QC (RAND)  |
|   3 |    VIEW                              |                 |  8168 |  1100K|    34   (3)| 00:00:01 |  Q1,00 | PCWP |            |
|   4 |     COLLECTION ITERATOR PICKLER FETCH| F_PARALLEL_PIPE |  8168 |       |    34   (3)| 00:00:01 |  Q1,00 | PCWP |            |
|   5 |      PX BLOCK ITERATOR               |                 |   798K|    97M|  2659   (1)| 00:00:02 |  Q1,00 | PCWC |            |
|   6 |       TABLE ACCESS FULL              | T1              |   798K|    97M|  2659   (1)| 00:00:02 |  Q1,00 | PCWP |            |
Note
   - dynamic sampling used for this statement (level=4)
17 rows selected.
SQL>

Similar Messages

  • In Mac's PAINTR application, what exactly does the "Splash" function do?

    n Mac's PAINTR application, what exactly does the "Splash" function do?

    You might also post your question over in the Mac App Store section of the Community, where you might have a better chance of running into someone else using the Paintr App.
    Mac App Store: Apple Support Communities
    Dennis

  • Pipeline functions - what happens under the hood?  (10g)

    Hi all,
    What happens when you call a pipelined function? (As opposed to a plain table-valued function.)
    From what I understand, a pipelined function will return rows as they are needed. Let's say I have a really silly example of a pipelined function,
    CREATE OR REPLACE PACKAGE BODY TEST_PACKAGE_1
    AS
        FUNCTION GET_DATA RETURN JUST_A_TABLE PIPELINED
        IS
        BEGIN
            PIPE ROW (JUST_A_TYPE('HELLO'));
            PIPE ROW (JUST_A_TYPE('WORLD'));
            RETURN;
        END;
    END TEST_PACKAGE_1;
    /Then let's say I were to SELECT * FROM TABLE(TEST_PACKAGE_1.GET_DATA) WHERE ROWNUM = 1, what happens to the second row? Does the code that returns the second row still get educated? (Obviously it's omitted from the query, but does it still get generated somewhere and just go nowhere?)
    If I have a cursor on a PL/SQL block that selects from GET_DATA, will each row only be returned as the cursor references it? In that case, what happens to the rows that don't get selected? If there some resource that need to be closed out (say, just before the return statement), would it still be safe to close it out?
    Thanks!
    Don

    Interesting question, lets try a simple test and see we'll just take your example function and toss in a few dbms_output statements like so:
    CREATE OR REPLACE PACKAGE BODY TEST_PACKAGE_1
    AS
        FUNCTION GET_DATA RETURN JUST_A_TABLE PIPELINED
        IS   
        BEGIN
            dbms_output.put_line('ONE');
            PIPE ROW (JUST_A_TYPE('HELLO'));       
            dbms_output.put_line('TWO');
            PIPE ROW (JUST_A_TYPE('WORLD'));       
            dbms_output.put_line('THREE');
            RETURN;   
        END;
    END TEST_PACKAGE_1;Now not forgetting to enable dbms_output call it three times like so:
    SELECT * FROM TABLE(TEST_PACKAGE_1.GET_DATA) WHERE ROWNUM = 1;
    SELECT * FROM TABLE(TEST_PACKAGE_1.GET_DATA) WHERE ROWNUM <= 2;
    SELECT * FROM TABLE(TEST_PACKAGE_1.GET_DATA) WHERE ROWNUM <= 3;What I saw from my test was that with the first call I got 1 row of data from the pipelined function and only the first dbms_output statement was processed. For the second statement I got 2 rows of data from the function and the first two dbms_output statements were processed. For the final call I again got 2 rows of data from the function and all 3 dbms_output statements were processed.
    My environment:
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    "CORE     10.2.0.1.0     Production"
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production

  • Re: In Mac's PAINTR application, what exactly does the "Splash" function do?

    In Mac's PAINTR application, what exactly does the "Splash" function do?  It isn't mentioned in the Toolbox Documentation, but the "Splash" option is given right next to the "Draw" option at the top of the screen in the application itself.

    You might also post your question over in the Mac App Store section of the Community, where you might have a better chance of running into someone else using the Paintr App.
    Mac App Store: Apple Support Communities
    Dennis

  • What is the exact syntax for calling remote function module.

    Hi to all
    1.....what is the exact syntax for calling remote function module.?
    Thanks and regards,
    k.swaminath reddy

    hi
    good
    Lets do simple example where you will first create a RFC in one server (say A) and create normal program in othere server (say B). Finally you will call the RFC in A from B.
    Do the following steps for creating RFC in server A.
    1. log on to server A
    2. go to se37
    3. Edit -> function groups-> create function group and give the function group name (say ZGRP).
    4. create a FM ( say Z_TEST_RFC) in se37 providing the function group which is created just now.
    5. go to attribute tab -> choose remote-enabled module from processing type.
    so that your FM will become RFC.
    6. provide the import parameter in import tab.
    we will provide only two import parameters.
    - parameter name : P_NUM1, typing: TYPE, associated type : I & check the pass value (all the parameters of RFC must pass by value).
    - parameter name : P_NUM2, typing: TYPE, associated type : I & check the pass value
    7. provide the export parameter in export tab.
    parameter name : P_SUM, typing: TYPE, associated type : I & check the pass value
    8. write the given simple code in source code tab.
    FUNCTION Z_TEST_RFC.
    P_TOT = P_NUM1 + P_NUM2.
    ENDFUNCTION.
    Do the following steps for creating ABAP program which will call the RFC in server B.
    1. se38 - > creat a program.
    2. write the given simple code.
    data tot type i.
    call function 'Z_TEST_RFC' destination 'XXXXXX'
    exporting
    p_num1 = 10
    p_num2 = 15
    importing
    p_tot = tot.
    write tot.
    please note that XXXXXX is RFC connection which is avialable in sm59 transaction in server A.
    -go to sm59 - > abap connection (list of RFC connection configurations are avialable). choose server B connection and replace it of XXXXXX in the code.
    finally you can execute the normal abap program that will call the RFC and display the result.
    reward point if helpful.
    thanks
    mrutyun^

  • What is the role of the RETURN clause in a pipelined function?

    I wrote several pipelined functions and they work just fine without the return clause. However in the oracle's documentation there are returns in the pipelined functions:
    CREATE FUNCTION StockPivot(p refcur_pkg.refcur_t) RETURN TickerTypeSet
    PIPELINED IS
      out_rec TickerType := TickerType(NULL,NULL,NULL);
      in_rec p%ROWTYPE;
    BEGIN
      LOOP
        FETCH p INTO in_rec;
        EXIT WHEN p%NOTFOUND;
        -- first row
        out_rec.ticker := in_rec.Ticker;
        out_rec.PriceType := 'O';
        out_rec.price := in_rec.OpenPrice;
        PIPE ROW(out_rec);
        -- second row
        out_rec.PriceType := 'C';  
        out_rec.Price := in_rec.ClosePrice;
        PIPE ROW(out_rec);
      END LOOP;
      CLOSE p;
      RETURN;
    END;
    /http://docs.oracle.com/cd/E11882_01/appdev.112/e10765/pipe_paral_tbl.htm#CHDJEGHC
    Moreover, at least in PL/SQL developer I recieve hints that my pipelined functions return no values, though as I said the functions work smoothly. So is there a need in the return clause in pipelined functions or it is redundant?
    My oracle version is 11.2.0.2.0

    As already mentioned, in later versions of the database it doesn't appear to be necessary, however, it IS good programming practice (and necessary in non-pipelined functions) to always ensure a function has a RETURN statement in it. It could be a 'side effect' (read that as bug if you like) that it doesn't appear to be necessary, so you would be best to ensure you DO include a RETURN statement, as documented.

  • Interactive Report using a View with a Pipelined Function

    Hello fellow Apex people,
    I'm Using Application Express 4.1.0.00.32
    I've got an interactive report that references a view (STOCK) and a pipelined function
    The basic query is listed below.
    SELECT S.CHANGED_TIME "Changed Time"
    , S.CHANGED_BY "Changed By"
    , S.ID "Id"
    , STKST_DESCRS.STOCK_STATUS_CODES "Stock Status Codes"
    , STKST_DESCRS.STOCK_STATUS_DESCRS "Stock Status"
    , S.ORIGINAL_CONTAINER "Original Container"
    FROM STOCK S
    , table(LWS_StkstStatus (S.ID)) STKST_DESCRS
    ORDER BY S.CO_ID,
    S.SEQUENCE_NUM;
    When the page is first run all the data is displayed correctly,
    If I define a filter, sort or a blank search the data from the pipelined function (STKST_DESCRS.) becomes null and isn't displayed.
    Does anyone know what is happening?
    Many Thanks

    I'm curious why you find this dangerous. I want a report that looks like this:
    Opportunity X:
    4 - 2-apr-2008 - Closed deal
    3 - 1-mar-2008 - Called Joe again
    2 - 12-feb-2008 - Called Joe
    1 - 14-jan-2008 - Initial call with customer.
    When you enter a new note, I want it to be numbered 5. The only problem I can imagine is someone deleting a note, which will almost never happen, and if it does, it just leaves a numbering gap. I don't see how using the function in a SELECT will accomplish this.

  • What are  the input parameters for Function Module

    Dear Experts,
    I want to generate a Sales Tax returns report,those fields are not available in my existing Datasources.
    For that i want to write a Generic Datasource with Function Module.
    audat
    bukrs
    vkorg
    vtweg
    spart
    aurat
    auart
    netwr
    mwsbp
    kschl zedp(consition type)
    kschl zvat(condition type)
    ksch   zcst(condition type)
    matkl     material group
    Here what are the Input parameters for Function Module.
    Thanks in Advance.
    Srinivasan.

    Srinivasan-
    For creating a Generic extractor based on a FM, you first of all need to know what is going to be your structure.. i.e. what all fields you need to pull from what all tables. A functional consultant may help you identify the exact DB tables.
    Once you know them, hand over the requirement and the pdf mentioned by Krishna to the ABAP guy, he would be able to take this up further.
    Also decide 1st whether you would be using a full load or delta. There is a slight difference in the way they are built.
    Let me know how it goes.
    -Bhushan.

  • Pipelined function with lagre amount of data

    We would like to use pipelined functions as source of the select statements instead of tables. Thus we can easily switch from our tables to the structures with data from external module due to the need for integration with other systems.
    We know these functions are used in situations such as data warehousing to apply multiple transformations to data but what will be the performance in real time access.
    Does anyone have any experience using pipelined function with large amounts of data in the interface systems?

    It looks like you have already determined that the datatable object will be the best way to do this. When you are creating the object, you must enter the absolute path to your spreadsheet file. Then, you have to create some type of connection (i.e. a pushbutton or timer) that will send a true to the import data member of the datatable object. After these two things have been done, you will be able to access the data using the A3 - K133 data members.
    Regards,
    Michael Shasteen
    Applications Engineering
    National Instruments
    www.ni.com/ask
    1-866-ASK-MY-NI

  • What exactly are unscaledWidth and unscaledHeight in mobile item renderers?

    Hello,
    What exactly are unscaledWidth and unscaledHeight that get passed to the measure() method for a mobile item renderer?
    I am guessing renderers start at  "default" width and height (so unscaled) which get scaled based on DPI. Is that it?
    Thank you.

    measure() doesn't take any parameters so I assume you mean the layoutContents() and/or drawBackground() methods.
    If you look at the code in LabelItemRenderer (and MobileSkin) for updateDisplayList() you'll see that it just delegates the work to the drawBackground() and layoutContents() methods:
        override protected function updateDisplayList(unscaledWidth:Number,
                                                      unscaledHeight:Number):void
            // clear the graphics before calling super.updateDisplayList()
            graphics.clear();
            super.updateDisplayList(unscaledWidth, unscaledHeight);
            drawBackground(unscaledWidth, unscaledHeight);
            layoutContents(unscaledWidth, unscaledHeight);
    This was done to make it a little bit easier for people to subclass LabelItemRenderer/IconItemRenderer by breaking the positioning logic apart from drawing the background visuals.  Check out the documentation for UIComponent.updateDisplayList and look around on Google for more information on how updateDisplayList fits into the Flex component life cycle.

  • Pass multiple values as single input parameter into pipelined function

    Hi all,
    My need is to pass multiple values as single input parameter into pipelined function.
    For example - "2" and "3" are values of input parameter "t":
    with data as (
    select 1 as t from dual union all
    select 2 as t from dual union all
    select 3 as t from dual union all
    select 4 as t from dual union all
    select 5 as t from dual
    select * from data where t in (2,3)Is it possible at all?

    Not exactly sure, but usually 'multiple values'+'pipelined function' = some IN-LIST related approach?
    See:
    SQL> create table data as
      2  select 1 as t from dual union all
      3  select 2 as t from dual union all
      4  select 3 as t from dual union all
      5  select 4 as t from dual union all
      6  select 5 as t from dual;
    Table created.
    SQL> --
    SQL> CREATE OR REPLACE FUNCTION in_list (p_in_list  IN  VARCHAR2)
      2  RETURN sys.odcivarchar2list PIPELINED
      3  AS
      4    l_text  VARCHAR2(32767) := p_in_list || ',';
      5    l_idx   NUMBER;
      6  BEGIN
      7    LOOP
      8      l_idx := INSTR(l_text, ',');
      9      EXIT WHEN NVL(l_idx, 0) = 0;
    10      PIPE ROW (TRIM(SUBSTR(l_text, 1, l_idx - 1)));
    11      l_text := SUBSTR(l_text, l_idx + 1);
    12    END LOOP;
    13 
    14    RETURN;
    15  END;
    16  /
    Function created.
    SQL> --
    SQL> select *
      2  from   data
      3  where  t in ( select *
      4                from   table(in_list('1,2'))
      5              );
             T
             1
             2
    2 rows selected.http://www.oracle-base.com/articles/misc/dynamic-in-lists.php
    or
    http://tkyte.blogspot.nl/2006/06/varying-in-lists.html

  • So what exactly does limited to "one app" mean with a Pro account and the new prices?

    So it seems Pro has dropped in price but it is now limited to "one App".
    So what exactly does that "one App" mean?
    Only one tablet version or one phone version for a certain title?
    Or you can have a tablet & phone version including android & iOS for that one title?

    I think that everyone received it just now…
    Changes to Adobe Digital Publishing Suite, Professional Edition
    Effective immediately, all customers who newly purchase or renew Digital Publishing Suite (DPS), Professional Edition, will be able to publish only one app per license of DPS Professional Edition.
    Under this policy change, Professional Edition customers can publish an unlimited number of issues (.folio files) to a single app and distribute those issues based on purchased fulfillment bundles.
    An app created with a single license of DPS Professional Edition can be distributed to any or all of the marketplaces that DPS supports, including the Apple App Store (and Newsstand), Google Play, Amazon Appstore, and the Windows Store.
    In conjunction with this policy change, Adobe is reducing the price of a Professional Edition license to $4,800 USD annually (€3,600/¥480,000) or to $400 per month (€300/¥40,000) and will include 1,000 fulfillments annually. The number of fulfillments included with a monthly subscription remain unchanged.
    This policy does not apply to test or demo apps published using Professional Edition. The one-app-per-license policy applies only to an app published to a supported marketplace(s).
    If you are an agency, upon your renewal or purchase of Professional Edition, you can create only one app per Professional Edition license. If you have multiple clients for whom you are creating apps, either you as the agency or your client must purchase a Professional Edition license for each app published to a supported marketplace(s).
    If you are an existing Professional Edition customer and choose to renew your Professional Edition license at the end of your annual agreement, these changes, including the lower price point and 1,000 fulfillments, apply at that time. These changes do not apply to your existing DPS Professional Edition agreement and take effect only if you renew your license.
    DPS Professional Edition customers can continue to create unlimited Single Edition apps, which is unchanged under the new policy. A Single Edition app is defined as an app that includes one built-in or embedded folio.
    If you expect to publish three or more apps annually, we encourage you to contact your local reseller to discuss pricing for a multi-year Enterprise Edition license.
    Enterprise Edition offers additional functionality and benefits not available through Professional Edition. These include app customization, integration with back-end business systems, in-app marketing tools, targeted content based on user entitlement, and the ability to publish apps privately.

  • PIPELINE function in oracle

    Hi,
    Can any body tells when to use PIPELINE function in simple words.
    Thanks,
    Vinod

    910575 wrote:
    Can any body tells when to use PIPELINE function in simple words.Wrong question.
    Correct question - WHAT is a pipeline table function.
    If you understand WHAT it is, you will be able to determine WHEN to use it.
    So have you read the documentation? Tried coding your own pipeline function? Do you understand what it is and how it works?

  • PL/SQL Pipelined Function to Compare *ANY*  2 tables

    I am trying to create a pipelined function in 10g R1 that will take the name of two tables, compare the the tables using dynamic SQL and pipe out the resulting rows using the appropriate row type. The pipelined function will be used in a DML insert statement.
    For example:
    create table a (f1 number, f2, date, f3 varchar2);
    create table b (f1 number, f2, date, f3 varchar2);
    create table c (f1 number, f2, date, f3 varchar2);
    create or replace TYPE AnyCollTyp IS TABLE OF ANYTYPE;
    create or replace TYPE CRowType IS c%ROWTYPE;
    create or replace TYPE CRowTabType IS table of CRowType;
    CREATE OR REPLACE FUNCTION compareTables (p_source IN VARCHAR2, p_dest IN VARCHAR2)
    RETURN AnyCollTyp PIPELINED
    IS
    CURSOR columnCur (p_tableName IN user_tab_columns.table_name%TYPE)
    IS
    SELECT column_name, column_id
    FROM user_tab_columns
    WHERE table_name = p_tableName
         ORDER BY column_id;
    l_cur sys_refcursor;
    l_rec ANYTYPE;
    l_stmt VARCHAR2 (32767);
    BEGIN
    l_stmt := 'select ';
    FOR columnRec IN columnCur (p_dest)
    LOOP
    l_stmt := l_stmt || CASE
    WHEN columnRec.column_id > 1
    THEN ','
    ELSE ''
    END || columnRec.column_name;
    END LOOP;
    l_stmt := l_stmt || ' from ' || p_source;
    l_stmt := l_stmt || ' minus ';
    l_stmt := l_stmt || ' select ';
    FOR columnRec IN columnCur (p_dest)
    LOOP
    l_stmt := l_stmt || CASE
    WHEN columnRec.column_id > 1
    THEN ','
    ELSE ''
    END || columnRec.column_name;
    END LOOP;
    l_stmt := l_stmt || ' from ' || p_dest;
    OPEN l_cur FOR l_stmt;
    LOOP
    FETCH l_cur
    INTO l_rec;
    PIPE ROW (l_rec);
    EXIT WHEN l_cur%NOTFOUND;
    END LOOP;
    CLOSE l_cur;
    RETURN;
    END compareTables;
    The pipelined function gets created without error. However, the testCompare procedure gets an error:
    SQL> create or replace procedure testCompare is
    begin
    insert into c
    select *
    from (TABLE(CAST(compareTables('a','b') as cRowTabType)));
    dbms_output.put_line(SQL%ROWCOUNT || ' rows inserted into c.');
    end;
    Warning: Procedure created with compilation errors.
    SQL> show errors
    Errors for PROCEDURE TESTCOMPARE:
    LINE/COL ERROR
    3/4 PL/SQL: SQL Statement ignored
    5/47 PL/SQL: ORA-22800: invalid user-defined type
    Does anyone know what I am doing wrong? Is there a better way to compare any two tables and get the resulting rows?

    904640 wrote:
    Hi All,
    Is it possible to post messages to weblogic JMS queue from pl/sql procedure/function?
    From this Queue, message will be read by OSB interface.
    Any help will be highly appreciated.
    http://www.lmgtfy.com/?q=oracle+pl/sql+weblogic+jms+queue

  • Pipelined function ignores DML changes on subqueries

    Hello all,
    I have a really specific issue when using a pipelined function used in a complex subquery where the function ignores the changes made on the current transaction. The problem is the hidden hint materialize sometimes used by the Oracle optimizer. I say sometimes because it depends mostly on the execution plan and the complexity of the query.
    I can repeat the problem with a dummy scenario.
    Let's say we have a dummy table with a simple record :
    CREATE TABLE DUMMY ("NAME" VARCHAR2(50 BYTE));
    INSERT INTO DUMMY VALUES('Original name');
    We then create a package which will contain our pipelined function and its record object and collection:
    CREATE OR REPLACE PACKAGE PKG_DUMMY AS
    TYPE DUMMY_RECORD IS RECORD (NAME VARCHAR2(50 BYTE));
    TYPE DUMMY_RECORDS IS TABLE OF DUMMY_RECORD;
    FUNCTION FUNC_GET_DUMMY_NAME RETURN DUMMY_RECORDS PIPELINED;
    END PKG_DUMMY;
    CREATE OR REPLACE
    PACKAGE BODY PKG_DUMMY AS
    FUNCTION FUNC_GET_DUMMY_NAME RETURN DUMMY_RECORDS PIPELINED AS
    BEGIN
    FOR CUR IN ( SELECT * FROM DUMMY )
    LOOP
    PIPE ROW (CUR);
    END LOOP;
    END FUNC_GET_DUMMY_NAME;
    END PKG_DUMMY;
    With this SQL query, we can return the value of the table by the pipelined function :
    WITH DUMMY_NAME AS
    SELECT "NAME"
    FROM TABLE(PKG_DUMMY.FUNC_GET_DUMMY_NAME())
    SELECT "NAME"
    FROM DUMMY_NAME
    Result
    Original name
    If we modify the DUMMY table with a new name without a commit, and re-execute the query, we got the same result :
    UPDATE DUMMY SET "NAME" = 'New name';
    Result
    New name
    But if we add the materialize hint in the subquery (without doing a commit or rollback), we have the original value hence my issue :
    WITH DUMMY_NAME AS
    SELECT /*+ materialize */ "NAME"
    FROM TABLE(PKG_DUMMY.FUNC_GET_DUMMY_NAME())
    SELECT "NAME"
    FROM DUMMY_NAME
    Result
    Original name
    I know I can force my subquery to use an inline hint instead of the "materialize" hint chose by the optimizer but then the query lose a lot of performance. Is there a way to force Oracle to use current DML changes with the materialize hint on a pipelined funtion in a subquery?
    This thread is also for this issue : http://stackoverflow.com/questions/1597467/is-using-a-select-inside-a-pipelined-pl-sql-table-function-allowed

    Hi Eliante, Hi Dominic,
    Very Interesting. Here what I can reproduce in Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    sql > truncate table dummy;
    Table truncated.
    sql >INSERT INTO DUMMY VALUES('Original name');
    1 row created.Please pay attention that I didn't commit
    sql > with dummy_name as
      2  (
      3  select  "NAME"
      4  from table(pkg_dummy.func_get_dummy_name())
      5  )
      6  select "NAME"
      7  from dummy_name;
    NAME
    Original name
    sql> start c:\dispcursor
    PLAN_TABLE_OUTPUT
    SQL_ID  838mtur4m74j2, child number 0
    with dummy_name as ( select  "NAME" from table(pkg_dummy.func_get_dummy_name()) ) select "NAME"
    from dummy_name
    Plan hash value: 117055
    | Id  | Operation                         | Name                | Starts | A-Rows |   A-Time   | Buffers |
    |   1 |  COLLECTION ITERATOR PICKLER FETCH| FUNC_GET_DUMMY_NAME |      1 |      1 |00:00:00.01 |      15 |
    Note
       - rule based optimizer used (consider using cbo)
    17 rows selected.
    sql > with dummy_name as
      2  (
      3  select /*+ materialize */ "NAME"
      4  from table(pkg_dummy.func_get_dummy_name())
      5  )
      6  select "NAME"
      7  from dummy_name;
    no rows selected
    sql >start c:\dispcursor
    PLAN_TABLE_OUTPUT
    SQL_ID  9frx3wjk992rd, child number 0
    with dummy_name as ( select /*+ materialize */ "NAME" from table(pkg_dummy.func_get_dummy_name()) ) select "NAME" from dummy_name
    Plan hash value: 1359790764
    | Id  | Operation                           | Name                        | Starts | E-Rows | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
    |   1 |  TEMP TABLE TRANSFORMATION          |                             |      1 |        |      0 |00:00:00.01 |      20 |       |       |          |
    |   2 |   LOAD AS SELECT                    |                             |      1 |        |      0 |00:00:00.01 |      19 |  1024 |  1024 |          |
    |   3 |    COLLECTION ITERATOR PICKLER FETCH| FUNC_GET_DUMMY_NAME         |      1 |        |      0 |00:00:00.01 |      17 |       |       |          |
    |   4 |   VIEW                              |                             |      1 |   8168 |      0 |00:00:00.01 |       0 |       |       |          |
    |   5 |    TABLE ACCESS FULL                | SYS_TEMP_0FD9D780C_BD7649E3 |      1 |   8168 |      0 |00:00:00.01 |       0 |       |       |          |
    16 rows selected.I can point out that the TABLE ACCESS FULL of the global temporary SYS_TEMP_0FD9D780C_BD7649E3 table created by Oracle in response to the -materialize hint is returning *0 rows* in operation 5.
    Why?
    It seems for me that the reason for that comes from the fact that the creation of this SYS_TEMP_0FD9D780C_BD7649E3 table is done via direct path read/direct path write and as far as
    the insert of *'Original name'* has not been pushed yet into the disc then materializing the query will generate an empty temporary table (empty in this case).
    This is why if I had committed I will not have seen such a kind of discrepancy between those two queries
    What do you think?
    Mohamed Houri
    www.hourim.wordpress.com

Maybe you are looking for

  • Aperture crashes when using NIK Plug-In

    I have a Mac Pro 2008 8-core 2.8 with 16 GB ram and the ATI HD 5870. Sometimes in Aperture 3 (newest update) when using NIK plug-in colorefex pro 4 it crashes. It only crashes when performing certain tasks, like certain recipes.  Or more often when I

  • JPanel sometimes doesn't display correctly

    I have this JFrame which contains a single JPanel as its content pane. I have the paintComponent() overriden so that the panel paints a background that creates the basis for the GUI. The problem is that sometimes when I run the program (I've tried it

  • Best way to wireless print from ipad (without wifi)?

    I work with kids in various settings and would like to print from the ipad when I have no wifi available. What is my best option?

  • My "What's New" procedure doesn't show the result Search result page

    Hi, I needed a "What's New" report for a content area. The advanced search screen has the option to query with the create date, but you can save the search with something like #sysdate-7. So I created the following procedure: create or replace proced

  • Static class error

    I have a static class: package VO     public class ArrayValues         private static var instance:ArrayValues = new ArrayValues();         // dummy values will be first replaced with English versions         // if the user clicks "Spanish" they will