APEX interactive report on a global temporary table

Hello
I tried to build an interactive report on a global temporary table (starry on commit), which is created with a cron every hour. Problem is that the sql to create the temporary table runs about 10 minutes, putting thus the sql directly in the page makes no sense.
When I create the report, he sees all the columns, but no data. I can query the good data from sqlplus or through sqldeveloper. I'm doing something wrong?

THX,
Dennis

Hello

How to fill collection?

Check APEX_COLLECTION procedures
CREATE_COLLECTION_FROM_QUERY_B
CREATE_COLLECTION_FROM_QUERYB2

http://download.Oracle.com/docs/CD/E17556_01/doc/apirefs.40/e15519/apex_collection.htm#CJAHBBGD

Kind regards
Jari

Tags: Database

Similar Questions

  • Edit and a global temporary table

    Hi all

    Can someone tell me why when I create a TWG and insert the data as the followijng, I get insert 14 ranks msg. But when I do a select statement of the sqlwork shop, sometimes I get the data sometimes that I don't have. my understanding is that these data are supposed to stay during my session logon then got cleaned up when I left the session.
    I develop a screen in the apex and will use this temporary table for the user to perform editing work. Once Island edition done then I save the data in a static table. Is this possible? So far my every attempt to update that the temporary table always results in 0 rows updated in the temporary table and reversed to 0 lines. Can you help me?

    CREATE A GLOBAL TEMPORARY TABLE 'EMP_SESSION '.
    (SELECT "EMPNO" NUMBER NOT NULL,)
    'ENAME' VARCHAR2 (10),
    VARCHAR2 (9) "JOB."
    NUMBER OF "MGR."
    "HIREDATE" DATE,
    NUMBER OF "SAL."
    NUMBER OF THE "COMM"
    NUMBER OF "DEPTNO".
    ) ON COMMIT PRESERVE ROWS
    /

    insert into emp_session (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO)
    Select * from EMP
    --
    Select * from emp_session
    -Sometimes I 14 ranks, sometimes 0 rows

    Thank you.

    Tai

    APEX does NOT support the use of TWG... Use rather a collection to manipulate your temporary data... : http://www.dba-oracle.com/t_easy_html_db_collection.htm

    Thank you

    Tony Miller
    Webster, TX

  • Need help with a global temporary table

    Can someone please help, the following line of code:

    CREATE TEMPORARY TABLE global tbl_bulknodes_temp (obt_uuid VARCHAR2) ON COMMIT DELETE ROWS

    Yeilds the following error running in SQL and PL/SQL

    Error from the 1 in the command line:
    CREATE TEMPORARY TABLE global tbl_bulknodes_temp (obt_uuid VARCHAR2) ON COMMIT DELETE ROWS
    Error report:
    SQL error: ORA-00906: lack of left parenthesis

    Hello

    You need the length of varchar2 column...

    SQL> CREATE GLOBAL TEMPORARY TABLE tbl_bulknodes_temp ( obt_uuid VARCHAR2(30) ) ON COMMIT DELETE ROWS;
    
    Table created
    
    SQL> CREATE GLOBAL TEMPORARY TABLE tbl_bulknodes_temp2 ( obt_uuid VARCHAR2 ) ON COMMIT DELETE ROWS;
    
    CREATE GLOBAL TEMPORARY TABLE tbl_bulknodes_temp2 ( obt_uuid VARCHAR2 ) ON COMMIT DELETE ROWS
    
    ORA-00906: missing left parenthesis
    
    SQL> 
    

    Kind regards

  • ORA-20987: APEX - interactive report region does not exist in the application

    ORA-20987: APEX - interactive report region does not exist in the application

    I'm trying to get the query of an international registration (interactive report) on a specific page in my application.

    The code I am using is thesi:

    create or replace function get_report_query (nPage_id number)

    return varchar2

    as

    l_report apex_ir.t_report;

    l_query varchar2 (32767).

    l_list varchar2 (32767).

    number of nRegion_id;

    number of nIR_id;

    OWA.vc_arr nm;

    VL owa.vc_arr;

    BEGIN

    SELECT region_id

    IN nRegion_id

    Of apex_application_page_regions

    WHERE application_name = "E-BRIL.

    AND page_id = nPage_id

    AND source_type = "interactive report";

    nIR_id: =.

    apex_ir.get_last_viewed_report_id (p_page_id = > nPage_id,)

    p_region_id = > nRegion_id);

    NM (1): = "DUMMY_JUST_TO_SET_UP_OWA_UTIL";

    VL (1): = 'WHATEVER ';

    OWA.init_cgi_env (nm.count, nm, vl);

    l_report: = APEX_IR. () GET_REPORT

    p_page_id = > nPage_id,

    p_region_id = > nRegion_id,

    p_report_id = > 0);

    l_query: = l_report.sql_query;

    because me in 1.l_report.binds.count

    loop

    l_list: = l_list | i||'. '|| l_report. Binds (i) .name | » ='|| l_report. Binds (i) .value;

    end loop;

    Return l_query;

    end;

    /

    I want to get the query of the IR on my page 3. And I run;

    get_report_query (3)

    That's what I get:

    ORA-20987: APEX - interactive report region does not exist in application, page 3 and 1278226325207011749 region. -Contact your administrator of the application.

    ORA-06512: at "APEX_040200.WWV_FLOW_ERROR", line 630

    ORA-06512: at "APEX_040200.WWV_FLOW_ERROR", line 911

    ORA-06512: at "APEX_040200.WWV_FLOW_WORKSHEET_UTIL", line 33

    ORA-06512: at "APEX_040200.WWV_FLOW_WORKSHEET_UTIL", line 55

    ORA-06512: at "EBR_OWNER. GET_REPORT_QUERY', line 19

    The regio_id seems ok, because when I ask this region_id of apex_application_page_regions, id 1278226325207011749 is returned.

    Page 3 is also correct.

    I tried to follow Denes Kubicek his blog (Denes Kubicek ApEx BLOG: interactive report query is).

    What I'm doing wrong here?

    We use the Apex 4.2.

    Thanks in advance.

    Reg,

    Chris

    1717220 wrote:

    Please update your forum profile with a recognizable username instead of "1717220": Video tutorial how to change username available

    ORA-20987: APEX - interactive report region does not exist in the application

    I'm trying to get the query of an international registration (interactive report) on a specific page in my application.

    The code I am using is thesi:

    create or replace function get_report_query(nPage_id IN number)
    return varchar2
    as
    l_report  apex_ir.t_report;
    l_query  varchar2(32767);
    l_list  varchar2(32767);
    nRegion_id number;
    nIR_id number;
    nm  owa.vc_arr;
    vl  owa.vc_arr;
    BEGIN 
    
        SELECT region_id
        INTO nRegion_id
        FROM apex_application_page_regions
        WHERE application_name = 'E-BRIL'
          AND page_id = nPage_id
          AND source_type = 'Interactive Report';
    
        nIR_id :=
          apex_ir.get_last_viewed_report_id (p_page_id        => nPage_id,
                                            p_region_id      => nRegion_id);
    
        nm(1) := 'DUMMY_JUST_TO_SET_UP_OWA_UTIL';
        vl(1) := 'WHATEVER';
        owa.init_cgi_env( nm.count, nm, vl );
    
        l_report := APEX_IR.GET_REPORT (
                        p_page_id  => nPage_id,
                        p_region_id => nRegion_id,
                        p_report_id => 0); 
    
        l_query := l_report.sql_query;
        for i in 1..l_report.binds.count
        loop
            l_list := l_list||i||'. '||l_report.binds(i).name||'='||l_report.binds(i).value;
        end loop;
    
    return l_query;
    end;
    

    I want to get the query of the IR on my page 3. And I run;

    get_report_query (3)

    That's what I get:

    ORA-20987: APEX - interactive report region does not exist in application, page 3 and 1278226325207011749 region. -Contact your administrator of the application.

    ORA-06512: at "APEX_040200.WWV_FLOW_ERROR", line 630

    ORA-06512: at "APEX_040200.WWV_FLOW_ERROR", line 911

    ORA-06512: at "APEX_040200.WWV_FLOW_WORKSHEET_UTIL", line 33

    ORA-06512: at "APEX_040200.WWV_FLOW_WORKSHEET_UTIL", line 55

    ORA-06512: at "EBR_OWNER. GET_REPORT_QUERY', line 19

    The regio_id seems ok, because when I ask this region_id of apex_application_page_regions, id 1278226325207011749 is returned.

    Page 3 is also correct.

    I tried to follow Denes Kubicek his blog (Denes Kubicek ApEx BLOG: interactive report query is).

    What I'm doing wrong here?

    We use the Apex 4.2.

    The '0' in line 31 should be "nIR_id".

    What is the purpose of the lines 24-26?

  • Are global temporary tables, a standard feature of Oracle?

    I apologize for introducing me to this community with what must seem like a very stupid question...

    I am a software developer, working on a product that uses Oracle as its database, specifically Oracle 11 g Enterprise Edition. Recently, I solved a problem of performance by converting an ordinary table into a global temporary table. Before my boss allows me to put this change in the product, it wants to be sure that global temporary tables are a standard part of Oracle, not something that the customer must install separately or pay extra for. (This is the first time that we never used them in our product, so I think that most of the team are not familiar with them).

    I know that Oracle has had global temporary tables since the last millennium, so if ever, they have been a feature of the premium, they are unlikely to be now, but the boss wants me to get independent confirmation of this.

    Thank you.

    Steve Pemberton

    Here you can see "feature availability by Edition":

    http://docs.Oracle.com/CD/E11882_01/license.112/e47877/editions.htm#DBLIC116

    TWG tables is not even mentioned, which means that they do not belong to the functional components are paid separately.

    One caveat - if you have an application that uses connection pooling, it is recommended to use ON COMMIT DELETE ROWS, not ON COMMIT PRESERVE ROWS

    (or always use explicitly "DELETE gtt_table" at the beginning), because otherwise a user of the application can display the data TWG who has previously made a second user of the application.

    Kind regards

    Zlatko

  • PLS-00357 on a global temporary table

    Oracle 11g R2

    I am using a dynamic SQL statement to delete rows. The WHERE THERE EXIST uses a global temporary table and it gives me

    PLS-00357: Table, view or reference sequence "TMPPRE_ARC" not allowed in this context

    Any ideas of a work around?

    create global temporary table tmppre_arc
      ( id number)
      ON COMMIT PRESERVE ROWS;
    
    
    CREATE OR REPLACE PROCEDURE test_del
    IS
       v_owner_tbl varchar2(61) := 'test_table'     ;
    BEGIN   /* DELETE_SOURCE */
            EXECUTE IMMEDIATE
                'DELETE FROM ' || v_owner_tbl || ' v ' || chr(10) ||
                'WHERE EXISTS ( SELECT    null '       || chr(10) ||
                'FROM      ' || tmppre_arc || ' r '  || chr(10) ||
                'WHERE       r.id     = v.id )' ;
    END test_del;
    /
    show errors
    
    
    LIsNE/COL ERROR
    -------- -----------------------------------------------------------------
    5/9      PL/SQL: Statement ignored
    8/29     PLS-00357: Table,View Or Sequence reference 'TMPPRE_ARC' not
    allowed in this contenxt
    
    
    
    
    
             allowed in this context
    

    This is false:

    'FROM ' | tmppre_arc | ' r '  || Chr (10) |

    Should be

    "OF tmppre_arc r | Chr (10) |

    SY.

  • find global temporary tables

    Hi all

    How to find global temporary tables in all_tables, is this possible?

    What:

    
    select * from all_tables where temporary = 'Y';
    
  • What to fill in 'field of the temporary table' for global temporary tables?

    Hello

    I use the Data Modeler 4.0.1.836 and everything that I put in the box 'the scope of the table temp' for a global temporary table doesn't seem to affect the DDL script about the ON COMMIT PRESERVE/DELETE the LINES option. The script poster ON COMMIT PRESERVE ROWS always anything.

    Yet, some of my temporary tables must be created as ON COMMIT DELETE ROWS.

    Using the Data Modeler wrote about it:

    Scope of the temporary Table:

    For a class as a temporary table, you can specify a scope, such as the Dimension or the Session.

    Not sure what 'Dimension' has to do with the scope here, but it makes no difference.

    I tried to put 'Session', 'Dimension', 'Operation', but no luck. So what is the text for the script generate ON COMMIT DELETE ROWS?

    Thank you

    Hello

    The temporary Scope of Table property (on page Types of Classification of the table properties dialog box) is purely documentary.

    To set ON COMMIT DELETE ROWS you must expand the browser for the relational model and find the node for the relevant Oracle physical model.  If you develop it you will find an entry there for your Table. Double-click on that to get the physical model properties dialog box for your table, and you will find a "Temporary" facility that has options (Preserve Rows), YES (Delete Rows) YES or no.

    David

  • Global temporary tables

    Hi, db 10g,

    I created a global temporary table with this statement:

    create a table temporary global items (item_id);

    and tried to insert inside of Toad, and I got the message

    1 row inserted,

    but when I asked it, I got

    no selected line?

    I tried the script several times, and the result is the same?

    Thank you

    Hello

    Hi Salem wrote:

    It worked, I added this clause

    ON COMMIT PRESERVE ROWS;

    to create it, statement and it worked correctly, but are not this clause the default?

    No, the default is ON COMMIT DELETE ROWS.  I don't know why; ON COMMIT PRESERVE ROWS seems to be much more widely used.

  • Global temporary table in PL/SQL with XML

    Hello

    I have the impression that it is something strange or maybe I'm missing something basic.

    Step 1: Create a global Temp table that should not be specific transaction.

    create a global temporary table Temp01

    (

    NUMBER OF TICKET_ID

    , Varchar2 (10) of the REGION

    NUMBER OF THE YEAR

    , CO_ID VARCHAR2 (10)

    ) ON COMMIT DELETE ROWS.

    Step 2:

    My XML that goes as a parameter to a new function.

    < TICKET >

    < TICKET_ID > 38498051 < / TICKET_ID >

    the USA < REGION > < / REGION >

    < YEAR > 2014 < / YEAR >

    XYZ123 < CO_ID > < / CO_ID >

    < / TICKET >

    Step 3: Create a Stand Alone function:

    -drop function aagarwal.wr_creation;

    create or replace FUNCTION XML_FUNC

    (

    ret_msg out varchar2,.

    p_xmlval IN varchar2

    )

    RETURN varchar2

    is

    l_xmlval varchar2 (4000): = p_xmlval;

    V_CO_ID VARCHAR2 (10);

    V_CODE VARCHAR2 (10);

    BEGIN

    BEGIN

    INSERT INTO Temp01

    (

    TICKET_ID,

    REGION,

    BLEACHED,

    CO_ID

    )

    SELECT

    EXTRACTVALUE (XmlType (p_xmlval), "/ TICKET/TICKET_ID ') ID,.

    EXTRACTVALUE (XmlType (p_xmlval), "/ TICKET/REGION") REGION.

    EXTRACTVALUE (XmlType (p_xmlval), "/ TICKET per YEAR"),.

    EXTRACTVALUE (XmlType (p_xmlval), "/ TICKET/CO_ID ') CO_ID

    FROM DUAL;

    ret_msg: = 'SUCCESS';

    -SELECT CO_ID IN V_CO_ID of aagarwal. TEMP_STAGE_WR;

    -return ret_msg;

    EXCEPTION

    WHILE OTHERS THEN

    ret_msg: = sqlerrm;

    Return ret_msg;

    END;

    BEGIN

    SELECT CO_ID INTO V_CO_ID FROM Temp01;

    / * MERGE IN the site is

    With the HELP of aagarwal. TEMP01 T

    WE (T.co_id = se.code AND se.type_nm = ' TYPE' and se.src_nm = T.region)

    WHEN NOT MATCHED THEN

    INSERT (ID, SRCNM, CODE, TYPENM)

    VALUES (SHARED_SEQ. NEXTVAL, T.region, T.co_id, 'TYPE');

    -commit; */

    return ret_msg | "ACE" | v_co_id;

    END;

    END;

    /

    Fact - created function.

    NOTE: MERGE statement is blocked and if the function was created in sweetness.

    Step 4: Call the function

    declare

    l_out varchar2 (50);

    l_outr varchar2 (50);

    p_xml XMLTYPE.

    Start

    l_outr: = XML_FUNC (l_out, ' < TICKET >)

    < TICKET_ID > 38498051 < / TICKET_ID >

    the USA < REGION > < / REGION >

    < YEAR > 2014 < / YEAR >

    XYZ123 < CO_ID > < / CO_ID >

    (< / TICKET > ');

    dbms_output.put_line (l_outr);

    end;

    /


    Step 5: Check the value being inserted into the temporary Table:


    Select * from temp01;


    So far so good.

    THE PROBLEM:

    Now I want to tweek the XML_FUNC function above by uncommenting MERGE statement, which brings me to an error that is not differentiable:

    I.e. PL/SQL: ORA-00942: table or view does not exist in line on MERGE pointing to Temp01 statement.

    NOTE: I tested this Merge statement explicitly (as long as the execution of Stand Alone and also by calling via anonymous block PLSQL) and its absolutely perfect work. And SITE table exist.

    PS: I would be grateful, if there is a better way to write this code? I'm not a regular PLSQL developer and so badly can write the code of practice.

    Kind regards

    AAG.

    Using 11.2.0.3:

    Owner of all these three objects is DBA.

    Are you sure?

    After the release of:

    Select object_name, object_type

    of object

    where object_name in ('TEMP01', 'SITE', 'XML_FUNC');

    You must grant the explicit right to select on the table for the owner of the function if the owners are different.

    This works as expected for me (user DEV has all 3 items):

    Connected to Oracle Database 11g Enterprise Edition Release 11.2.0.3.0

    Logged in as dev

    SQL >

    SQL > create a global temporary table Temp01)

    NUMBER OF TICKET_ID 2

    3, Varchar2 (10) of the REGION

    4, NUMBER OF THE YEAR

    5, CO_ID VARCHAR2 (10)

    6)

    7. ON COMMIT DELETE ROWS.

    Table created

    SQL >

    SQL > create table site)

    Identification number 2

    3, srcnm varchar2 (10)

    4, code varchar2 (10)

    5, typenm varchar2 (10)

    6  );

    Table created

    SQL > create the sequence shared_seq;

    Order of creation

    SQL >

    SQL >

    SQL > create or replace FUNCTION XML_FUNC)

    2 p_xmlval IN varchar2

    3)

    4 RETURN varchar2

    5 is

    6 l_xmlval xmltype: = xmltype (p_xmlval);

    7. START

    8

    9 INSERT INTO Temp01

    (10)

    TICKET_ID 11,

    REGION 12,

    13 YEARS,

    CO_ID 14

    15)

    16. SELECT ID EXTRACTVALUE(l_xmlval, '/TICKET/TICKET_ID'),

    17 EXTRACTVALUE(l_xmlval, '/TICKET/REGION') REGION,

    18 EXTRACTVALUE (l_xmlval, ' / TICKET per YEAR ') YEAR.

    19 EXTRACTVALUE(l_xmlval, '/TICKET/CO_ID') CO_ID

    20 FROM DUAL;

    21

    22. MERGE IN site

    23. WITH THE HELP OF TEMP01 T

    (24)

    25 T.co_id = se.code

    26 AND se.typenm = 'TYPE '.

    27 and se.srcnm = T.region

    28)

    29 WHEN NOT MATCHED THEN

    30 INSERT (ID, SRCNM, CODE, TYPENM)

    31 VALUES (SHARED_SEQ. NEXTVAL, T.region, T.co_id, 'TYPE');

    32

    33 return "SUCCESS";

    34

    35 END;

    36.

    Feature created

    SQL >

    SQL >

    SQL > set serveroutput on

    SQL >

    SQL >

    SQL > declare

    2

    3 l_outr varchar2 (50);

    4

    5. start

    6

    7 l_outr: = XML_FUNC (')

    8 38498051

    9 USA

    10 2014

    11 XYZ123

    12    ');

    13

    14 dbms_output.put_line (l_outr);

    15

    16 end;

    17.

    SUCCESS

    PL/SQL procedure successfully completed

    SQL > select * from site;

    ID CODE TYPENM SRCNM

    ---------- ---------- ---------- ----------

    TYPE 1 USA XYZ123

  • trigger on the global temporary table

    Hello

    I have a global temporary table

    CREATE GLOBAL TEMPORARY table to register)

    no_registre NUMBER primary key,

    date of create_time

    ) ON COMMIT DELETE ROWS.

    I have to write a trigger on the table every time that the insertion is made.

    create or replace trigger tri_register

    before inserting the REGISTER

    for each line

    Start

    : new create_Date: = sysdate;

    end;

    /

    This trigger can work on this registry table?

    Thank you

    913578 wrote:

    Sorry Karthik.

    the thing is that I did not have privelleges to test, I send the code to some dba who makes deployment.

    Sorry to hear that!

    Please tell me... We can write triggers on GTT?

    of course, you can!

    SQL > create a global temporary table registry
    () 2
    no_registre 3 number primary key,
    create_time date 4
    5)
    6 on the validation to delete lines;

    Table created.

    SQL > create or replace trigger register_trig before insert in the register for each line
    2 start
    3: new.create_time: = sysdate;
    4 end;
    5.

    Trigger created.

    SQL > insert into values of registry (no_registre) (1);

    1 line of creation.

    SQL > select * from registry;

    NO_REGISTRE CREATE_TI
    ----------- ---------
    1 8 JULY 13

  • How to insert into a GLOBAL TEMPORARY TABLE and get the data from it?

    The requrement is
    Split the string ENTRY point on the base and store it in a Collection. And the values of the collection will be stored in a global temporary table. Then, I'm updating some other table based on the data from the temporary table.

    There is in fact no error message. But there is no data in the temporary table and also no change in the update statement

    First of all, I'm creatiing a global temporary table only once outside the procedure.

    CREATE GLOBAL TEMPORARY table GLt (data_element number)


    create or replace procedure test_proc (p_in_string VARCHAR2) is
    i the number: = 0;
    number of POS: = 0;
    CLOB lv_str: = p_in_string;
    p_delim VARCHAR2 (1): = ', ';

    TYPE t_array IS TABLE OF VARCHAR2 (20) INDEX directory.
    t_array channels;

    BEGIN

    -cutting of string input and store in the strings (i) collection

    POS: = instr (lv_str, p_delim, 1, 1);
    WHILE (pos! = 0) LOOP
    i: = i + 1;
    Strings (i): = substr(lv_str,1,pos-1);
    lv_str: = substr (lv_str, pos + 1, length (lv_str));
    POS: = instr (lv_str, p_delim, 1, 1);
    IF pos = 0 THEN
    Strings (i + 1): = lv_str;
    END IF;
    END LOOP;

    run immediately "drop table TWG;
    run immediately ' CREATE GLOBAL TEMPORARY table (data_element number) TWG on commit preserve rows ";

    FORALL i in strings.first... Strings.Last
    INSERT INTO VALUES TWG (strings (i));
    commit;

    Update first_tbl set PIN is "XXX" where first_col in (select data_element from TWG);.
    commit;

    END test_proc;

    Published by: cedric b on January 25, 2013 12:59

    Remove the two execute immediate line. They are wrong.

    And then use the table in your code that you created at the beginning. The name is GLT.
    And delete the first commit. This validation would empty the temporary table of GLT.

    You get an error? Or it does not work as expected?

    Also, show how you call the procedure.

    Published by: Sven w. January 25, 2013 14:45

  • Global temporary Table problem in ADF

    Hello

    I have an application where I need to use a TWG (on the ranks of commit preserve) DB and try to insert data to TWG of screw ADF.
    But the table does not store data even after the Commit command. [Even I tried with permament DB table, and it worked.]

    Could someone help me find the problem with inserting data TWG.


    Kind regards
    Manju

    It is not a good idea to use a global temporary Table in an ADF application. The problem is that all web applications are really stateless. ADF maintains the State of a session data backup or reload it when necessary. Regarding the database, ADF can disconnect a session from the database at any time and connect to another session. This means that you do not necessarily have a continuous database session, then the lines you wrote to a TWG may well gone with the following query. There are ways to tell ADF not to do, but they have a considerable performance drop.

    Therefore, rethinking how you will save temporary information for the duration of a user session. You can do it in an object view ADF BC (VO) - interviewed by VO data carried session - if ADF needs to share a user session to load the data of another user (this is called "passivation") it will save these data. Then when ADF 'active' session, he'll find the saved data and reload it. Or you can use a permanent table with your name or session id - a little more complicated, but possible.

    If you want to tell us a little bit your use case - you need your application to do so, we may have other alternatives.

  • declare a global temporary table

    Hello
    can I use the declare global temporary table (...) ststement of pl/sql, I need a temporary table for the current session.


    If not, what should be the alternative?

    Thank you...

    Published by: Amoeba on 23 August 2012 13:39

    Published by: Amoeba on 23 August 2012 13:41

    Hello

    >
    can I use declare global temporary table (...) as ststement of pl/sql, like I need a temporary table for the current session.

    If not, what should be the alternative?

    Thank you...
    >
    This query actually belongs to SQL and PL/SQL Forum. Please take care and post in the correct forum.

    In any case...
    CREATE TABLE TEMPORARY global is a DDL command. Once created TWGS will exist until he FELL. Try to create a TWG with the same name will fail. just like any table, view, etc. See http://docs.oracle.com/cd/B28359_01/server.111/b28310/tables003.htm#i1006400

    a: you can create a TWG once and use/re-use it anywhere in your code.
    (b) as it is a DDL you can not use in the DECLARE section. You can use BEGIN and EXCEPTION.

    See you soon,.

  • problem of global temporary table in different environment

    I have 2 environment
    production of 1) development) 2.

    developing oracle version is-
    ----------------------------------------
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    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
    in prodcution
    -----------------
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    CORE    10.2.0.4.0    Production
    TNS for Linux: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    We use two global temporary tables (tmp_transaction tmp_category_mv)(development and production).
    Both are contains the same set of data. I compared the data set.all are the same.
    but the return of different query defined in the development environment.

    But instead of a global temporary table in the development, it returns the same result, defined as the production, I used a normal array.

    Please suggest me what I do?

    my query
    ===========
    select /*+ parallel(t,4) */
                t.transaction_id,
                cr.cat_rule_id,
                cr.apply_seq,
                t.site_id,
                cr.site_id cat_rule_site_id
            from
                tmp_transaction t
                    left outer
                    join tmp_category_mv cr on
                            (cr.data_feed_code is null
                            or t.data_feed_code = cr.data_feed_code)
       and (cr.min_date is null or t.transaction_date > min_date)
       and (cr.max_date is null or t.transaction_date < max_date)
       and (cr.local_commodity_code is null or t.local_commodity_code like cr.local_commodity_code)
       and (t.local_supplier_code = cr.local_supplier_code)
       and (cr.local_commodity_name is null or t.local_commodity_name like cr.local_commodity_name)
       and (cr.invoice_description is null or t.invoice_description like cr.invoice_description)
       and (cr.cost_centre_name is null or t.cost_centre_name like cr.cost_centre_name)
       and (cr.purchase_order_description is null or t.purchase_order_description like cr.purchase_order_description)
       and (cr.purchase_order_line_desc is null or t.purchase_order_line_desc like cr.purchase_order_line_desc)
       and (cr.gl_code is null or t.gl_code like cr.gl_code)
       and (cr.gl_name is null or t.gl_name like cr.gl_name)
       and (cr.material_group_code is null or t.material_group_code like cr.material_group_code)
       and (cr.material_group_name is null or t.material_group_name like cr.material_group_name)
       and (cr.material_code is null or t.material_code like cr.material_code)
       and (cr.material_name is null or t.material_name like cr.material_name);
    Published by: BluShadow on February 8, 2012 13:29
    addition of {noformat}
    {noformat} tags. Please read {message:id=9360002} and learn to do this yourself.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                

    Hello

    Could be

    Bug 6193398: QUERY PARALLEL WITH an OUTER JOIN ON TEMPORARY DELIVERS INCORRECT RESULTS TABLE

    Database version 10.2.0.2.0

    Status 80 - development of Q / A

    WORKAROUND SOLUTION:
    - - - - - - - - - -
    Use the series query or table normal and not temporary.

    Concerning
    Peter

    EDIT: Status seems to be incorrect, in patch has been in 10.2.0.4

    No MOS?

    Published by: Peter on 8 February 2012 14:28

Maybe you are looking for