What to fill in "temp table scope" for global temporary tables?

Hi,
I'm using Data Modeler 4.0.1.836 and whatever I put in the "temp table scope" box for a global temporary table doesn't seem to affect the DDL script regarding the ON COMMIT PRESERVE/DELETE ROWS option. The script always shows ON COMMIT PRESERVE ROWS no matter what.
Yet, some of my temporary tables must be created as ON COMMIT DELETE ROWS.
The Data Modeler help says the following about this :
Temp Table Scope:
For a table classified as Temporary, you can specify a scope, such as Session or Dimension.
Not sure what "Dimension" has to do with the scope here, but it doesn't make any difference.
I tried putting "Session", "Dimension", "Transaction", but no luck. So what's the text to put for the script to generate ON COMMIT DELETE ROWS?
Thanks

Hi,
The Temporary Table Scope property (on the Classification Types page of the Table Properties dialog) is purely documentary.
To set ON COMMIT DELETE ROWS you should expand the Browser node for the Relational Model and look for the node for the relevant Oracle Physical Model.  If you expand this you will find an entry there for your Table. Double-click on this to get the Physical Model properties dialog for your table, and you will find a "Temporary"  property which has options YES (Preserve Rows), YES (Delete Rows) or NO.
David

Similar Messages

  • How can i write the trigger for Global Temporary Table

    Hi Grus,
    How can i write the trigger for Global Temporary Table.
    I was created the GTT with trigger using the below script .
    CREATE GLOBAL TEMPORARY TABLE GLOBAL_TEMP
    EMP_C_NAME VARCHAR2(20 BYTE)
    ON COMMIT PRESERVE ROWS;
    CREATE OR REPLACE TRIGGER TRI_GLOBAL_TEMP
    BEFORE DELETE OR UPDATE OR INSERT
    ON GLOBAL_TEMP
    REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    BEGIN
    INSERT INTO EMPNAME VALUES (:OLD.EMP_C_NAME);
    END;
    trigger was create successfully, but the wouldn't insert into to EMPNAME Table..
    Please guide whether am correct or not? if not kindly give a correct syntax with example
    Thanks in Advance,
    Arun M M

    BEGIN
    INSERT INTO EMPNAME VALUES (:OLD.EMP_C_NAME);
    END;
    you are referencing old value in insert stmt.
    BEGIN
    INSERT INTO EMPNAME VALUES (:new.EMP_C_NAME);
    END;then run ur application it works fine...
    CREATE GLOBAL TEMPORARY TABLE GLOBAL_TEMP
    EMP_C_NAME VARCHAR2(20 BYTE)
    ON COMMIT PRESERVE ROWS;
    CREATE OR REPLACE TRIGGER TRI_GLOBAL_TEMP
    BEFORE DELETE OR UPDATE OR INSERT
    ON GLOBAL_TEMP
    REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    BEGIN
    dbms_output.put_line(:OLD.EMP_C_NAME||'yahoo');
    INSERT INTO EMPNAME VALUES (:new.EMP_C_NAME);
    dbms_output.put_line(:OLD.EMP_C_NAME);
    END;
    create table EMPNAME as select * from GLOBAL_TEMP where 1=2
    insert into GLOBAL_TEMP values('fgfdgd');
    commit;
    select * from GLOBAL_TEMP;
    select * from EMPNAME;
    output:
    1 rows inserted
    commit succeeded.
    EMP_C_NAME          
    fgfdgd              
    1 rows selected
    EMP_C_NAME          
    fgfdgd              
    1 rows selectedgot it Arun
    Edited by: OraclePLSQL on Dec 28, 2010 6:07 PM

  • Create view for Global Temporary Table

    if view is create for global temporary table so exactly how it works which helps regarding application performance.
    Regaards,
    Sambit Ray

    A view is just a stored query. It can be on global temporary tables or regular one, makes no difference.

  • Grant table create for only temporary tables

    I looking for a way to allow user to create only temporary tables. The user does not need to create or drop any public tables.

    Hi,
    >>This is really a bad suggestion. The user1 can now only select his own tables, no insert or update. It can not be allowed in the "real world".
    The OP said "I looking for a way to allow user to create only temporary tables"
    I think that you didn't understand what I showed ...
    SYSTEM@test> create user user1 identified by user1 default tablespace USERS quota 0 on USERS;
    User created.
    SYSTEM@test> create user user2 identified by user2 default tablespace USERS quota unlimited on USERS;
    User created.
    SYSTEM@test> grant create session,create table, create synonym to user1,user2;
    Grant succeeded.
    SYSTEM@test> connect user2/user2@teste
    Connected.
    USER2@test> create table x (id number);
    Table created.
    USER2@test> insert into x values (1);
    1 row created.
    USER2@test> grant select,delete,insert,update on x to user1;
    Grant succeeded.
    USER2@test> connect user1/user1@teste
    Connected.
    USER1@test> create synonym x for user2.x;
    Synonym created.
    USER1@test> insert into x values (2);
    1 row created.
    USER1@test> select * from x;
            ID
             1
             2
    USER1@test> create table y (id number);
    create table y (id number)
    ERROR at line 1:
    ORA-01536: space quota exceeded for tablespace 'USERS'
    USER1@teste> create table user2.y (id number);
    create table user2.y (id number)
    ERROR at line 1:
    ORA-01031: insufficient privileges
    USER1@test> drop table user2.x;
    drop table user2.x
    ERROR at line 1:
    ORA-01031: insufficient privileges
    USER1@test> create global temporary table y (id number) on commit preserve rows;
    Table created.
    USER1@test> insert into y values (1);
    1 row created.
    USER1@test> select * from y;
            ID
             1
    USER1@test>Cheers

  • Can I use Parallel execution for Global Temporary table within SP and How

    Dear Gurus,
    I have Global temporary table as below
    Create global temporary table Temp_Emp
    empno number,
    ename varchar2(20),
    deptno number
    ) on commit preserve rows;
    During processing I insert the data into this table and then fire query on Temp_Emp, get the data and pass it to front end.
    The SP as shown below
    Create or replace procedure get_emp_data
    empid in number,
    emp_detail out RefCsr -- Ref cursor
    as
    begin
    -- some code here
    open emp_detail for
    select *
    from Temp_Emp
    where empno = empid;
    end get_emp_data;
    Can use Parallel Query execution on Temp_Emp table and how ?
    i.e. do need to explicitly use parallel construct in query or is it default.
    Because I have many SQL like above (on global temporary tables) within Stored Procedures.
    Can anybody give me any suggestion.
    Thanking in Advance
    Sanjeev

    How come you are populating a temporary table and then opening a cursor on this temporary table for the front end to use?
    Couldn't you presumably just form a query out of the code you use to populate the temporary table? This is the recommended approach in Oracle.

  • Can global temporary  table work for me?

    Hi i recently found out about GTT, I first created a table and inserted values into my new_table but it was
    I have a report that I need to display a time range based on the time given in the report, now each page of the report shows a different time range. I created a formula that would insert into a new_table based on the value of the time range, I would then pull the values from the table to the report in a repeating frame, this caused the problem because data in table is overwriting the previous page values before it is displayed on the screen(there is a delete from table in the formula). This is my problem, how can I pull from the table before its deleted, will GTT work , if so How?

    I have no idea if it will work as you neglected to provide any code and any information about how you are producing the reports and with what tool.
    There are two types of global temporary tables. Do you know the difference?
    The docs are at http://tahiti.oracle.com
    Demos of both types in Morgan's Library at www.psoug.org
    After you've read the Oracle docs and understand how they work.
    And after you've run the Library demos.
    If you still have questions post them here along with sufficient information for someone not sitting next to you to know what you are doing.

  • Using Global Temporary Table in Discoverer.

    Hi All
    I am currently working on a Disco report, where I am initializing a package at the disco condition level which inserts data in to a Global Temporary Table.
    The global temporary table will be having data based on the parameter entered by the user. But the problem occurs when we are trying to use the same GTT in the select statement as shown below. The desktop is not giving me the otuput but the GTT is getting populated with data.
    see below
    SELECT bla1,
    bla2,
    bla3
    FROM GTT (global temp table)
    WHERE 1= PACKAGE.FUNCTION(par1, par2, par3...) <- here we are trying to insert into GTT based on the paramenters passed.
    Can you please suggest how this can be achieved. Or is there any way to trigger the insertion in to GTT other than the calling it in the condition level.
    Thanks
    Arun

    Hi,
    You cannot use a GTT like this because you cannot write and read from the GTT using a single SQL statement. You must either have the insert in a separate worksheet and tell the users to run this worksheet first, or you wrap it all up in a table function called from within a view. The table function can then insert and select from the GTT using two statements.
    Which method is best depends on what you are trying to do and why you want to use a GTT.
    Rod West

  • Altering The Global Temporary Table

    I had created a temporary table but did not initially specically tells what to do when commiting a transaction.
    CREATE GLOBAL TEMPORARY TABLE APP_CONTROL_MENU_TEMP
    (...)I need to alter the table to add this option "ON COMMIT PRESERVE ROWS".

    Hi,
    You cannot specify ON COMMIT clause whenever ALTER TABLE, but whenever onCREATE GLOBAL TEMPORARY TABLE.
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_73a.htm#2159530
    Ig you haven't the DDL for recreate table you can use dbms_metadata.get_ddl function :
    SQL> set long 100000
    SQL> select dbms_metadata.get_ddl('TABLE','TT2') from dual;
    DBMS_METADATA.GET_DDL('TABLE','TT2')
      CREATE GLOBAL TEMPORARY TABLE "SCOTT"."TT2"
       (    "EMPNO" NUMBER(4,0),
            "ENAME" VARCHAR2(10),
            "JOB" VARCHAR2(9),
            "MGR" NUMBER(4,0),
            "HIREDATE" DATE,
            "SAL" NUMBER(7,2),
            "COMM" NUMBER(7,2),
            "DEPTNO" NUMBER(2,0)
       )  ON COMMIT DELETE ROWSAfter what you can recreate your table with the clause well. You will not loss data... by definition, this is a temporary table...
    Nicolas.

  • Life time of data in a Global Temporary Table.

    Dear Friends,
    I have a global temporary table in which I insert some values via a backend package, when forms start up and accessing it via the same package when user performs some changes in it - storing the value and during exit saving it in the master table. My problem is the data is not accessible while processing. I'm using Oracle9i Enterprise Edition Release 9.2.0.1.0 database and Forms [32 Bit] Version 6.0.8.8.0. I also give you the script in using which I created the temporary table.
    CREATE GLOBAL TEMPORARY TABLE GTT_PRA
    A1 VARCHAR2(10 BYTE) NOT NULL,
    A2 VARCHAR2(15 BYTE) NOT NULL,
    A3 VARCHAR2(10 BYTE) NOT NULL
    ON COMMIT DELETE ROWS;
    Why is that so? Please help me.
    With Regards,
    Senthil .A. Perumal.

    Dear Arun,
    Thank you for your script. But I'm accessing a large table, so for each and every process, the table get populated and grows very large giving some space problem, that is why I'm deleting rows when commiting. I would appreciate your help.
    Dear Yogesh,
    From the same forms I'm calling the backend package - will that be a different session. Once I'm calling to populate the table and next time I'm calling to store the user modified data and finally calling to store the data to master table. I think all are in the same sessions. Please reply me.
    Thank you dear friends fr your immediate response. I would really appreciate it.
    Regards,
    Senthil .A. Perumal.

  • Why can't global temporary tables have foreign keys?

    Hi,
    I have a forms module which shows two blocks. The first block is based on a normal database table EMP and the second one is based on a global temporary table SAL_TEMP. There is a master-detail relation between the two blocks. So far, in Designer I created two normal database tables EMP and SAL_TEMP and created a foreign key with validation level "none" from the table SAL_TEMP to the table EMP. By creating the foreign key, Designer generates code to automatically synchronize the data between the master and the detail block in my form.
    In the latest version of Designer it is finally possible to indicate a table as a global temporary table. But when I try to change my table SAL_TEMP to a global temporary table (session) I get an error that this is not allowed because my table contains foreign keys. So the Designer team finally implemented this feature but it is useless to me.
    Can someone explain to me the reason of this restriction?
    Vincent

    Just out of curiosity - which version of Designer supports the creation of global temp tables? We are running version 9.0.2.80.6 and, as far as I am award, this does not support it (unless I am being really thick!) - is this new 10g Dev. Suite functionality?
    thanks,
    Pete

  • Problem creating index on global temporary table

    Running Oracle DB Oracle9i Release 9.2.0.7.0.
    I'm trying to create 3 indexes on a temporary table, the first index creates fine but the other remaining 2 result in the following error:
    ERROR at line 1: ORA-00600: internal error code, arguments: [kftts2bz_many_files], [0], [20], [], [], [], [], []
    Have tried searching with not much success, any pointers, tips, hints would be appreciated, below is the table and the indexes:-
    create global temporary TABLE contacts (
    ID VARCHAR2(20) NOT NULL,
    DOB VARCHAR2(8),
    HH_LASTNAME VARCHAR2(90),
    PERSON VARCHAR2(10) NOT NULL,
    CONT_JOB VARCHAR2(90) NOT NULL,
    SOURCE VARCHAR2(8) NOT NULL,
    ADS VARCHAR2(8) NOT NULL,
    CONT VARCHAR2(8) NOT NULL,
    SRCPERSONID VARCHAR2(15),
    FIRSTNAME VARCHAR2(90),
    MIDDLENAME VARCHAR2(90),
    LASTNAME VARCHAR2(90),
    FULLNAME VARCHAR2(90),
    TITLE VARCHAR2(50),
    SALUTATION VARCHAR2(90),
    ) on commit delete rows;
    create index i_contact_1 on contacts(dob, soundex(hh_lastname ));
    create index i_contact_pk on contacts(id, person, cont_job, source, ads, cont);
    create index i_contact_2 on contacts(srcpersonid, source);

    Bug 3238525 - Upgrade from 9.0 can leave corruptdata for global temporary table indices
    ORA-600 [kftts2bz_many_files]
         Doc ID:      285592.1

  • What is the syntax for creating global temporary table using a select query

    hii
    I'm creating a global temporary table using a select query ..how to mention 'on commit preserve rows' that?
    create global temporary table t1 as select * from trn_ordbase on commit preserve rows;
    but this is invalid syntax,so how to mention on commit preserve rows in this???if i dont mention it ,by default its considering as on commit delete rows.
    Please help me out of this problem.

    create global temporary table t1 as select * from trn_ordbase on commit preserve rows;You CANNOT use this syntax.
    http://download-east.oracle.com/docs/cd/B19188_01/doc/B15917/sqcmd.htm
    http://download-east.oracle.com/docs/cd/B19188_01/doc/B15917/glob_tab.gif
    http://download-east.oracle.com/docs/cd/B19188_01/doc/B15917/cre_tabl.gif

  • Creating a Global Temporary Table on non-default TEMP tablespace.

    Hello ,
    I am using Oracle 11g.
    I have a procedure which create global temporary tables for its functionality. As the data which is going in the global temporary table , mean the data which is going in the default TEMP tablesapce is too huge ..... billions of rows..
    So what i want to do is , I want to create the global temporary table in another TEMP2 tablespace ( which is not the default one) so the load of billions of rows of data will be shifted to TEMP2. The default TEMP tablespace will not be affected and it can be used for other transactions.
    Is this possible. Can i shift the global temporary table from TEMP( Default temp tablespace) to TEMP2 ( the non-default temp tablespace) ????
    Please guide me with proper solutions and examples ....
    Thanks in advance ..

    DBA4 wrote:
    Hello ,
    I am using Oracle 11g.
    I have a procedure which create global temporary tables for its functionality. As the data which is going in the global temporary table , mean the data which is going in the default TEMP tablesapce is too huge ..... billions of rows..
    So what i want to do is , I want to create the global temporary table in another TEMP2 tablespace ( which is not the default one) so the load of billions of rows of data will be shifted to TEMP2. The default TEMP tablespace will not be affected and it can be used for other transactions.
    Is this possible. Can i shift the global temporary table from TEMP( Default temp tablespace) to TEMP2 ( the non-default temp tablespace) ????
    Global temporary tables are instantiated in the temporary tablespace of the schema that inserts the data - not into "the default" temporary tablespace.
    Assume Schema1 creates a GTT and grants all on that table to schema2
    Assume schema1 also creates a procedure (authid owner, the default) to insert data into the GTT and grants execute on the procedure to schema2
    If schema2 executes: insert into schema1.gtt, the data will appear in the temporary tablespace of schema2
    If schema2 executes: execute schema1.procedure, the data will appear in the temporary tablespace of schema1
    So if you want to protect the "normal" temporary tablespace, you could just create a special temporary tablespace for the owner of the procedure.
    Regards
    Jonathan Lewis

  • Global Temporary table is Not working For Pdf Reports

    Hi all
    we are using oracle db-10g, developer suite-10g.
    While generating the Report for the satisfying several conditions we are fetching the data into
    Global temporary table
    On commit preserve rows
    from this temp tables excel is generated properly. but pdf is not generating can anybody exaplain why it is not generating and what to do for that
    Thank you

    query and view are not possible
    here i am giving one of the requirement
    my project is belongs to inventory project.
    report should be generated on the different selection criteria like
    1)user can select one or more product codes
    2)for that product code one or more item codes can select
    like this so many different selection are there more than 12 selections from different tables
    For this each different selection product code into gtt_prod_cd and item_cd into gtt_item_cd. after that performed the query and in where clause we are comparing the values with gtt.
    can you please suggest me what to do for PDF Reports

  • How to find the count of tables going for fts(full table scan in oracle 10g

    HI
    how to find the count of tables going for fts(full table scan) in oracle 10g
    regards

    Hi,
    Why do you want to 'find' those tables?
    Do you want to 'avoid FTS' on those tables?
    You provide little information here. (Perhaps you just migrated from 9i and having problems with certain queries now?)
    FTS is sometimes the fastest way to retrieve data, and sometimes an index scan is.
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:9422487749968
    There's no 'FTS view' available, if you want to know what happens on your DB you need, like Anand already said, to trace sessions that 'worry you'.

Maybe you are looking for

  • Lumia 900 - My view

    Hello all, so after long debate I had finally decided to upgrade my Nokia N8 (Brilliant phone) I now own a Nokia Lumia 900 - white. I don't want to start of like most do on forums with problems here and there but a nice list of nice features I have c

  • Compiz not starting automatically?

    I'm using xfce. I did what the archwiki said add to the xml config file. But when I reboot, It still uses the defualt windows manager. It works with the fusion icon, but I don't want to use the fusion icon. Last edited by wsamh (2012-02-22 23:12:58)

  • Newby question.  Iweb not 'publishing' my websites properly anymore

    Hi, Since I updated Iweb to the latest version (2.0.3), my website pages won't 'publish to folder' properly. Examples of problems I'm encountering include: 1)The dynamic menu bar located at the top of every page no longer shows up on published pages.

  • Graph X-axis format

    Hello, I would like to change my X-axis (time axis) values of graduation. I want to make a numeric operation with each graduation. For example, now I have got all my graduation from 0 to 0,05 and I want them from 0 to the result of 0,05 / 2E-5. I wan

  • Galaxy Nexus Not connecting to network

    Good Evening, I just received a replacement phone for Galaxy Nexus. The phone is not connecting to network. I am able to connect to wifi but unable to make calls or send texts since having the phone activated last night.  When I was in the store last