Pipelined functions and reports

Hi all,
please consider this test case:
create type htmldb_obj as object (
a varchar2(10),
b varchar2(10)
create type htmldb_type2 as table of htmldb_obj;
create or replace function htmldb_f2 (p number)
return htmldb_type2
pipelined
is
begin
pipe row ( htmldb_obj( to_char(p), to_char(p) ) );
return;
end htmldb_f2;
In a "pl/sql function returning SQL string" report, this works like a charm:
begin
return 'select * from table (htmldb_f2 (cast(:APP_ID as number)));';
end;
But when trying to select column "a" instead of all columns:
begin
return 'select a from table (htmldb_f2 (cast(:APP_ID as number)));';
end;
report error:
ORA-00904: "HTMLDB_F2": invalid identifier
Even if the statement is correct:
test2@ORACLE9I> variable app_id varchar2(10);
test2@ORACLE9I> exec :app_id := '3';
PL/SQL procedure successfully completed.
test2@ORACLE9I> select a from table (htmldb_f2 (cast(:APP_ID as number)));
A
3
I've tried a few variations (casting the set returned by the function, using an in-line view) but the result is always the same: legal sql statements in sqlplus always gets the 'ORA-00904: "HTMLDB_F2": invalid identifier' error.
Please note that i cannot simply hide the function in a view since i have to supply a parameter.
What's wrong ?
Thanks in advance

o This works:
begin
return 'select a from table (htmldb_f2 (cast(nv(''APP_ID'') as number)));';
end;
o This doesn't:
begin
return 'select a from table (htmldb_f2 (cast(v(''APP_ID'') as number)));';
end;
Query cannot be parsed within the Builder. If you believe your query is syntactically correct, check the ''generic columns'' checkbox below the region source to proceed without parsing. ORA-00904: "V": invalid identifier
O This works:
begin
return 'select a from table (htmldb_f2 (cast('|| nv('APP_ID') ||' as number)));';
end;
My preference is on the first method (better sql cache utilization).
a) Are you interested in the results I will get after applying the HTMLDB patch ?
b) out of curiosity - does HTMLDB use dbms_sql to describe the statement and get the columns info ?
Thanks Scott - I'm more than happy with the workaround!
Alberto

Similar Messages

  • Tabular forms based on pipelined functions - can it be done?

    Hi there,
    Pipelined functions are great, specially when you want to encapsulate the access to tables instead of just SELECTing from them (what I am doing a lot in my current project.)
    However Apex 4 does not like them, at least not for tabular forms...
    I want to handle myself the update/insert/delete process, so I don't need the MRU default functionality (all the access to the data is via APIs). But at the same time I want to just SELECT from my pipelined function and set the item types using the builder interface as with any tabular form (without having to use the apex_item API). Also I want to be able to use tabular form validation.
    To start with, you can only create a tabular form based on a table or view. To overcome this issue, I created a dummy view with the fields I wanted and created my tabular form on it. Then I changed the FROM clause to FROM TABLE(myfunction). It didn't work as it seems it tries to select the ROWID for each row... Of course my pipelined function doesn't return one but I don't need one anyway as I will be doing the data manipulation myself based on the PK.
    For this to work, I had to create a collection, populate it with the result of the pipelined function in a page process every time the page is loaded, create a view on that collection and base the tabular form on the view... A lot of work and overhead for something that should be very simple in principle.
    Then, I found out that if I remove the default MRU process that is automatically created, the tabular form validations stop working (as I posted in another thread). So I have to leave a "dummy" MRU process there with condition = never for it to work.
    The application I am working on is all based on API calls and pipelined functions so all this work has to be repeated for each tabular form that is needed.
    If it was possible to base a tabular form directly on a pipelined function it would be such an elegant solution.
    Is there a better way to implement this? Shouldn't Apex be more compatible with pipelined functions? (at least in regards to tabular forms, they work well with normal forms, reports, LOVs etc)
    Thanks
    Luis

    As I mentioned before, I don't handle inserts (well, I cheat).... On my page, there is a form to set up a request - prompts for a few things, and when submitted, calls a stored procedure:
    :P2_REQUEST_RESULT := Simon.Apex_Campus_Guest.Setup_Request(:P2_GROUP_NAME,
           :P2_COAS_ORGN, :P2_START_DATE, :P2_END_DATE, :P2_Quantity, :P2_Generic_Names);
    Which creates an APEX collection, which in turn is made visible via a pipelined function turned into a view:
    create or replace view Apex_Campus_Guest_Request_va as
    select seq_no,
            user_name,
           group_name,
            comments
      from table ( Apex_Campus_Guest.Request_Result )
    I have a second region which is tabular form on a query - conditional on select 1 from Simon.apex_campus_guest_request_va (the view defined above).
    When this submitted, I have standard MRU and MRD processes (Seq_No is the primary key). This then runs into the appropriate trigger - the update trigger is as follows:
    trigger Apex_Campus_Guest_Req_Upd
    instead of update on Apex_Campus_Guest_Request_va
    for each row
    declare
            cg_rec  campus_guest_maint.rec;
    begin
            cg_rec := Campus_Guest_Maint.Request(
                            name => :new.user_name,
                            group_name => :new.group_name,
                            comments => :new.comments);
    end;I don't know off hand why it isn't asking for a rowid - but may be that I specified a PKEY column. The insert case fails, as it tries to add a "Returning" statement in the original select. I actually find that annoying as a function is defined to allocate the PKEY from a sequence, so it doesn't need to ask for it that way.

  • Apex can't parse query on pipelined function

    Hi,
    I have a report based on a sql query which selects from a pipelined function. The pipeline function and the collection sql type it returns live in the parsing schema of the application.
    I get the error: "Query cannot be parsed within the Builder." There is no ORA-xxxxx message.
    If I check "generic columns" (parse at runtime), and run, it says "ORA-00904 <name of pipelined function>: invalid identifier".
    If I qualify the name of the pipelined function with the schema name, it works.
    Or, if I replace the bind variables with literals, it works.
    Or, if I replace the columns with *, it works.
    I'm using Apex 2.0
    Does anyone have an ideas why I am seeing this behaviour?

    marnold,
    Can you show the query you're using in your report?
    I have used pipelined functions many times, you can see an example of how I've used them here -
    http://jes.blogs.shellprompt.net/2006/05/25/generic-charting-in-application-express/
    and I haven't encountered any significant problems.

  • 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

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

  • 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

  • Pipelined function solution

    Good Morning
    Can anyone help me to get started writting a pipelined function to convert a table like this
    Name Period start Period End
    Smith 3 5
    Smith 7 10
    Smith 12 16
    into a table tike this
    Name Periods
    Smith ooXXXoXXXXoXXXXXooooo
    or may be there is a simpler way of doing this?
    Thanks
    David Hills

    There's more to this problem than simple column concatenation. There is some processing reuired to fill the gaps between the start and end points of the periods.
    The following code takes a blunt instrument approach: pipelined function and bit masks. Perhaps some of the brains on this forum can come up with a more elegant approach. The function does, at least, have the virtue of working:
    SQL> select * from table( timelines)
      2  /
    NAME       TIMELINE
    Jones      oooXXXXXooXXoooooooXXXXX
    Smith      ooXXXoXXXXoXXXXXoooooooo
    SQL>Note that this code is very much a "coffee time" proof of concept, and contains a number of infelicitous repetitions. Improving this code is left as an exercise for the reader.
    Cheers, APC
    CREATE TABLE periods (Name varchar2 (10), Pstart number, Pend number)
    INSERT INTO periods VALUES ('Smith', 3, 5)
    INSERT INTO periods VALUES ('Smith', 7 ,10)
    INSERT INTO periods VALUES ('Smith', 12, 16)
    INSERT INTO periods VALUES ('Jones', 4, 8)
    INSERT INTO periods VALUES ('Jones', 11 ,12)
    INSERT INTO periods VALUES ('Jones', 20, 24)
    CREATE OR REPLACE TYPE tl_t AS OBJECT (name varchar2(10), timeline varchar2(24));
    CREATE OR REPLACE TYPE tl_nt AS TABLE OF tl_t
    CREATE OR REPLACE FUNCTION timelines
    RETURN tl_nt
    PIPELINED
    IS
       TYPE masks IS TABLE OF RAW(24) INDEX BY PLS_INTEGER;
       timeslot masks;
       return_value tl_t := tl_t(null, null);
       slots RAW(24);
       PROCEDURE pop_timeslot IS
       BEGIN
        timeslot(1)  := utl_raw.cast_to_raw('100000000000000000000000');
        timeslot(2)  := utl_raw.cast_to_raw('010000000000000000000000');
        timeslot(3)  := utl_raw.cast_to_raw('001000000000000000000000');
        timeslot(4)  := utl_raw.cast_to_raw('000100000000000000000000');
        timeslot(5)  := utl_raw.cast_to_raw('000010000000000000000000');
        timeslot(6)  := utl_raw.cast_to_raw('000001000000000000000000');
        timeslot(7)  := utl_raw.cast_to_raw('000000100000000000000000');
        timeslot(8)  := utl_raw.cast_to_raw('000000010000000000000000');
        timeslot(9)  := utl_raw.cast_to_raw('000000001000000000000000');
        timeslot(10) := utl_raw.cast_to_raw('000000000100000000000000');
        timeslot(11) := utl_raw.cast_to_raw('000000000010000000000000');
        timeslot(12) := utl_raw.cast_to_raw('000000000001000000000000');
        timeslot(13) := utl_raw.cast_to_raw('000000000000100000000000');
        timeslot(14) := utl_raw.cast_to_raw('000000000000010000000000');
        timeslot(15) := utl_raw.cast_to_raw('000000000000001000000000');
        timeslot(16) := utl_raw.cast_to_raw('000000000000000100000000');
        timeslot(17) := utl_raw.cast_to_raw('000000000000000010000000');
        timeslot(18) := utl_raw.cast_to_raw('000000000000000001000000');
        timeslot(19) := utl_raw.cast_to_raw('000000000000000000100000');
        timeslot(20) := utl_raw.cast_to_raw('000000000000000000010000');
        timeslot(21) := utl_raw.cast_to_raw('000000000000000000001000');
        timeslot(22) := utl_raw.cast_to_raw('000000000000000000000100');
        timeslot(23) := utl_raw.cast_to_raw('000000000000000000000010');
        timeslot(24) := utl_raw.cast_to_raw('000000000000000000000001');
       END pop_timeslot;
    BEGIN
        pop_timeslot;
        FOR rec IN (SELECT * FROM periods ORDER BY name, pstart) LOOP
            IF return_value.name IS NULL
            THEN
                return_value.name := rec.name;
                slots := utl_raw.cast_to_raw('000000000000000000000000');
            ELSIF rec.name != return_value.name
            THEN
                return_value.timeline := translate(utl_raw.cast_to_varchar2(slots), '01', 'oX');
                pipe row( return_value );
                return_value.name := rec.name;
                slots := utl_raw.cast_to_raw('000000000000000000000000');
            END IF;
            FOR i IN rec.pstart..rec.pend LOOP
                slots := utl_raw.bit_or(slots, timeslot(i));
            END LOOP;
        END LOOP;
        return_value.timeline := translate(utl_raw.cast_to_varchar2(slots), '01', 'oX');
        pipe row( return_value );
        RETURN;
    END timelines;
    /

  • Debugging Pipelined function in SQLDeveloper

    Hi All,
    I have a pipelined function and I am trying to process the rows returned from the function within a cursor. The basic layout of the PROCEDURE IS
    CURSOR C1 IS
    SELECT * FROM TABLE(tab_function(CURSOR(SELECT * FROM MYTAB)));
    BEGIN
    FOR R1 IN C1 LOOP
    INSERT R1 INTO MYTAB2
    END LOOP;
    END;
    When I run this in SQL*PLUS the procedure, works for while until it hits a genuine bug.
    However, if I try to debug the procedure in SQLDeveloper, it processes the first row correcly. But when it returns to the FOR..LOOP statement for the second row it falls over.
    I am inserting into a table within the loop but this is outside of the table function which should (at least in this case) behave as a normal table.
    Can anybody please help?
    Regards,
    Leo

    there is an active SQL Developer OTN forum, this may help - http://forums.oracle.com/forums/search.jspa?threadID=&q=Debugging+Pipelined+function&objID=f260&dateRange=all&userID=&numResults=15&rankBy=10001

  • Pipelined functions with spatial data

    hi,
    i've been trying to use pipelined functions (using the TABLE and CAST operators to query data from them) to retrieve large amounts of spatial data.
    i've followed the examples on metalink, and they work fine. my problem arises when i apply similar functions to query data using SDO_FILTER, i've been trying to pipe a mdsys.sdo_geometry datatype (ref cursor) into the function - returns null.
    are spatial datatypes supported for use in pipelined functions, and using the table and cast operators?
    if they are, where can i find further reading/reference on the subject?
    thanks
    santosh sewlal

    Check out http://otn.oracle.com/products/spatial/pdf/mapviewerfaq_31.pdf
    or
    You can look for a third party solution that can draw maps.
    Then you call out to this component from Forms.

  • Use PipeLine function as datasource

    Hi all.
    Does anybody use PipeLine function as datasource for Bi EE ? Do you have any experience ?

    For more discuss :
    I was read article from Venkatakrishnan
    http://oraclebizint.wordpress.com/2007/09/21/oracle-bi-ee-101323-ref-cursors-and-pipelined-functions/
    and in that case all lok's fine and work. But in my case I was neded disable aggregate and order by functionality , becouse have some Issues. can anybody comment this situation :What's wrong in using PipeLine and BIee ?

  • List View Report with pipelined function in Mobile application and ORA-01007: variable not in select list

    Hi!
    I have a problem with List View Report in mobile application (theme 50 in apex) after updating to apex 4.2.2. I created Report -> List View. I used select from pipelined function in Region Source. Then when page is running and submited three times (or refreshed three times) I get an error:
    Error during rendering of region "LIST VIEW".
    ORA-01007: variable not in select list
    Technical Info (only visible for developers)
    is_internal_error: true
    apex_error_code: APEX.REGION.UNHANDLED_ERROR
    ora_sqlcode: -1007
    ora_sqlerrm: ORA-01007: variable not in select list
    component.type: APEX_APPLICATION_PAGE_REGIONS
    component.id: 21230833903737364557
    component.name: LIST VIEW
    error_backtrace:
         ORA-06512: at "APEX_040200.WWV_FLOW_DISP_PAGE_PLUGS", line 4613
         ORA-06512: at "APEX_040200.WWV_FLOW_DISP_PAGE_PLUGS", line 3220
    I get this error only when I use select from pipelined function in Region Source (for example: "select value1, value2 from table(some_pipelined_function(param1, param2)) ").
    You can check it on http://apex.oracle.com/pls/apex/f?p=50591 (login - demo, password - demo).
    In this application:
    - I created package TAB_TYPES_PKG:
    create or replace PACKAGE TAB_TYPES_PKG IS
    TYPE cur_rest_r IS RECORD (
        STR_NAME          VARCHAR2(128),
        INFO              VARCHAR2(128)
    TYPE cur_rest_t IS TABLE OF cur_rest_r;
    END TAB_TYPES_PKG;
    - I created pipelined function TEST_FUNC:
    create or replace
    FUNCTION TEST_FUNC
    RETURN TAB_TYPES_PKG.cur_rest_t  PIPELINED IS
    r_cur_rest TAB_TYPES_PKG.cur_rest_r;
    BEGIN
    r_cur_rest.STR_NAME := 'ROW 1';
    r_cur_rest.INFO := '10';
    PIPE ROW (r_cur_rest);
    r_cur_rest.STR_NAME := 'ROW 2';
    r_cur_rest.INFO := '20';
    PIPE ROW (r_cur_rest);
    r_cur_rest.STR_NAME := 'ROW 3';
    r_cur_rest.INFO := '30';
    PIPE ROW (r_cur_rest);
    r_cur_rest.STR_NAME := 'ROW 4';
    r_cur_rest.INFO := '40';
    PIPE ROW (r_cur_rest);
    r_cur_rest.STR_NAME := 'ROW 5';
    r_cur_rest.INFO := '50';
    PIPE ROW (r_cur_rest);
    RETURN;
    END TEST_FUNC;
    - I created List View Report on Page 1:
    Region Source:
    SELECT str_name,
           info
    FROM TABLE (TEST_FUNC)
    We can see error ORA-01007 after refresing (or submiting) Page 1 three times or more.
    How to fix it?

    Hi all
    I'm experiencing the same issue.  Predictably on every third refresh I receive:
    Error
    Error during rendering of region "Results".
    ORA-01007: variable not in select list
    Technical Info (only visible for developers)
    is_internal_error: true
    apex_error_code: APEX.REGION.UNHANDLED_ERROR
    ora_sqlcode: -1007
    ora_sqlerrm: ORA-01007: variable not in select list
    component.type: APEX_APPLICATION_PAGE_REGIONS
    component.id: 6910805644140264
    component.name: Results
    error_backtrace: ORA-06512: at "APEX_040200.WWV_FLOW_DISP_PAGE_PLUGS", line 4613 ORA-06512: at "APEX_040200.WWV_FLOW_DISP_PAGE_PLUGS", line 3220
    OK
    I am running Application Express 4.2.2.00.11 on GlassFish 4 using Apex Listener 2.0.3.221.10.13.
    Please note: this works perfectly using a classic report in my desktop application; however, no joy on the mobile side with a list view.  I will use a classic report in the interim.
    My region source is as follows:
    SELECT description AS "DESCRIPTION", reference AS "REFERENCE" FROM TABLE(AUTOCOMPLETE_LIST_VIEW_FNC('RESULTS'))
    The procedure:
      FUNCTION AUTOCOMPLETE_LIST_VIEW_FNC(
          p_collection_name IN VARCHAR2)
        RETURN list_row_table_type
      AS
        v_tab list_row_table_type := list_row_table_type();
      BEGIN
        DECLARE
          jsonarray json_list;
          jsonobj json;
          json_clob CLOB;
        BEGIN
          SELECT clob001
          INTO json_clob
          FROM apex_collections
          WHERE collection_name = p_collection_name;
          jsonobj              := json(json_clob);
          jsonarray            := json_ext.get_json_list(jsonobj, 'predictions');
          FOR i IN 1..jsonArray.count
          LOOP
            jsonobj := json(jsonArray.get(i));
            v_tab.extend;
            v_tab(v_tab.LAST) := list_row_type(json_ext.get_string(jsonobj, 'description'), json_ext.get_string(jsonobj, 'reference'));
          END LOOP;
          RETURN(v_tab);
        END;  
      END AUTOCOMPLETE_LIST_VIEW_FNC;
    Thanks!
    Tim

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

  • Forms and Reports: Automated Test tools - functionality AND performance

    All,
    I'm looking to get a few leads on an automated test tools that may be used to validate Oracle forms and reports (see my software configuration below). I'm looking for tools that can automate both functional tests and performance. By this I mean;
    Functional Testing:
    * Use of shortcut keys
    * Navigation between fields
    * Screen organisation (filed locations)
    * Exercise forms validation (bad input values)
    * Provide values to forms and simulate user commit, and go and verify database state is as expected
    Performance Testing:
    * carry out tests for fixed user load
    * carry out tests for scaled step increase in user load
    * automated collection of log files and metrics during test
    So far I have:
    http://www.neotys.com/
    Thanks in advance for your response.
    Mathew Butler
    Configuration:
    Red Hat Enterprise Linux x86-64 architecture v4.5 64 bit
    Oracle Application Server 10.1.2.0.2 ( with patch 10.1.2.3 )
    Oracle Developer Suite (Oracle Forms and Reports) V10.1.2.0.2 ( with patch 10.1.2.3 )
    Oracle JInitiator 1.3.1.17 or later
    Microsoft Internet Explorer 6

    are there any tools for doing this activity like oracle recommended tools?
    Your question is unclear.  As IK mentioned, the only tool you need is a new version of Oracle Forms/Reports.  Open your v10 modules in a v11 Builder and select Save.  You now have a v11 module.  Doing a "Compile All PL/SQL" before saving is a good idea, but not required.  The Builders and utilites provided with the version 11 installation are the only supported tools for upgrading your application.  If you are trying to do the conversion of many Forms files in a scripted manner, you can use the Forms compiler in a script.  Generating new "X" files will also update the source modules (fmb, mmb, pll).  See MyOracleSupport Note 955143.1
    Also included in the installation in the Forms Migration Assistant.  Although it is more useful to people coming from older versions, it can also be used to move from v10 to 11.  It allows you to select more than one file at a time.  Documentation for this utility can be found in the Forms Upgrade Guide.
    Using the Oracle Forms Migration Assistant

  • Can't run host function in procedure and reports

    Hello
    i'm unable to use the host function in reports and procedure.
    host('ar60runb userid=apps/apps report=/vision/d01/oracle/visappl/fnd/11.5.0/reports/US/UBLPS1.rdf batch=yes mode=bitmap destype=file desname=/vision/d01/oracle/visappl/fnd/11.5.0/reports/US/UBLPS1.pdf desformat=pdf paraform=yes P_EMP_NO='||i.EMPLOYEE_NUMBER||' PAYDT='||i.PAY_RUN_DATE);
    Kindly help ASAP!!!!
    Regards
    Fahad

    "I noticed that when I publish apk from Flash I don't  have option to select path to android SDK below 2 checkboxes ( install app on device and run app on device after publishing)"
    Are you saying the 2 checkbox's are missing? If so ,(or even if not), perhaps you don't have the latest extension installed in flash?
    http://labs.adobe.com/technologies/flashpro_extensionforair/
    I had an issue like you describe before. Everything was updated with my machine and phone, usb debugging , allow installation of non market apps... but i was not able to manually install my own apk's on my device.
    If i were to put the .apk on my server or just drag it to the phone via USB i could not install it. it was "untitled" or "unknown" i forget.
    The only way it would work was on export "install application on the connected android device".
    However If i took anyone else's .apk made from flash, i could install it from my server or via usb drag/drop.
    Even at one point someone on the forum posted an apk and the source .fla
    Installed that apk? = YES
    Export the same .fla myself with no changes = FAIL to install (unless launching directly from flash).
    I was using windows xp, I happen to be upgrading my cpu last month so i installed windows 7 and re-installed flash, and now it works fine. I never figured it out. I was somehow producing non-viable .apks . However it works now and I have done nothing different (besides going from xp to win7 and reinstalling flash).
    "other air apps (from other ppl) work both on phone and device."
    I'm guessing you only installed other air4android apps from the market?
    If you haven't tried yet, i could email you a .fla and .apk, see if you can install that from your ftp. Then re-export if yourself and see if it fails again?
    edit:spelling

  • Calling PL/SQL Functions And Open Oracle Reports From ADF Application

    Hi all,
    My company will convert some projects from Oracle forms to Oracle ADF so, we need to call the PL/SQL functions and open the Oracle Reports (which are already exist) from ADF Application.
    Thank You..
    Jack.N

    Hi Jack.N,
    calling PL/SQL Functions -----> http://sameh-nassar.blogspot.com/2010/01/create-plsql-function-and-call-it-from.html
    Open Oracle Reports ---------> http://radio-weblogs.com/0137094/2008/06/15.html
    You will find The Integration between ADF and other systems in ---> http://wiki.oracle.com/page/ADF+Integration
    Sameh Nassar

Maybe you are looking for