Doubts about Temporary Table.

Hi,
I am using Temporary Table.
But the insert command takes too much time compare to insert in Normal table.
One more doubt about Temporary Table is:
Suppose there are two different users. They connect and first insert rows of their use .Now they go for select.
Does select of one user goes to check the rows of second user also or the temporary table treats 2 users data as inserted in 2 different tables?
Help!!!

Nested structure (not deep - deep means their a string or a table as a component)
TYPES: BEGIN OF tp_header_type,
         BEGIN OF d,
           empresa TYPE ...
           num_docsap TYPE ...
        END OF d,
        awkey TYPE ...
      END OF tp_header_type.
matt

Similar Messages

  • Question about temporary tables and imports.

    Hello everybody.
    Interesting one this. We have an application that uses global temporary tables. We refresh live to test using import of the application schema. I noticed when doing this yesterday that the temporary tables were being recreated in test as perminant rather than temporary.
    Is there a reason for this? Has anyone come across this before? Is there a way around it (apart from manual checking)?
    Many thanks
    Rup

    Could you specify how you found out that it is coming in as permanent?
    I believe exp/Imp will export and import it is Temporary table. I have just done a simple test to check and it works fine;
    Here is my test log:
    SQL> connect scott
    Enter password:
    Connected.
    SQL>SQL> CREATE GLOBAL TEMPORARY TABLE test_global
      2          (startdate DATE,
      3           enddate DATE,
      4           class CHAR(20))
      5        ON COMMIT DELETE ROWS;
    Table created.
    SQL>  select table_name,temporary from user_tables where table_name='TEST_GLOBAL';
    TABLE_NAME                     T
    TEST_GLOBAL                    Y
    SQL> select table_name,temporary from user_tables;
    TABLE_NAME                     T
    DEPT                           N
    EMP                            N
    BONUS                          N
    SALGRADE                       N
    TEST_GLOBAL                    Y
    SQL> exit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
    With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options
    C:\Documents\dbmsdirect\Testing\global>exp
    Export: Release 10.2.0.2.0 - Production on Wed Feb 20 12:18:45 2008
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Username: scott
    Password:
    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
    With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options
    Enter array fetch buffer size: 4096 >
    Export file: EXPDAT.DMP > test_global
    (2)U(sers), or (3)T(ables): (2)U > t
    Export table data (yes/no): yes >
    Compress extents (yes/no): yes >
    Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
    server uses AL32UTF8 character set (possible charset conversion)
    About to export specified tables via Conventional Path ...
    Table(T) or Partition(T:P) to be exported: (RETURN to quit) > test_global
    . . exporting table                    TEST_GLOBAL
    Table(T) or Partition(T:P) to be exported: (RETURN to quit) >
    Export terminated successfully without warnings.
    C:\Documents\dbmsdirect\Testing\global>sqlplus /nolog
    SQL*Plus: Release 10.2.0.2.0 - Production on Wed Feb 20 12:19:50 2008
    Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.
    SQL> connect scott
    Enter password:
    Connected.
    SQL> drop table test_global purge;
    Table dropped.
    SQL> exit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
    With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options
    C:\Documents\dbmsdirect\Testing\global>imp
    Import: Release 10.2.0.2.0 - Production on Wed Feb 20 12:20:19 2008
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Username: scott
    Password:
    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
    With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options
    Import file: EXPDAT.DMP > test_global.DMP
    Enter insert buffer size (minimum is 8192) 30720>
    Export file created by EXPORT:V10.02.01 via conventional path
    import done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
    import server uses AL32UTF8 character set (possible charset conversion)
    List contents of import file only (yes/no): no >
    Ignore create error due to object existence (yes/no): no >
    Import grants (yes/no): yes >
    Import table data (yes/no): yes >
    Import entire export file (yes/no): no > yes
    . importing SCOTT's objects into SCOTT
    . importing SCOTT's objects into SCOTT
    Import terminated successfully without warnings.
    C:\Documents\dbmsdirect\Testing\global>sqlplus /nolog
    SQL*Plus: Release 10.2.0.2.0 - Production on Wed Feb 20 12:22:44 2008
    Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.
    SQL> connect scott
    Enter password:
    Connected.
    SQL>
    SQL> select table_name,temporary from user_tables;
    TABLE_NAME                     T
    DEPT                           N
    EMP                            N
    BONUS                          N
    SALGRADE                       N
    TEST_GLOBAL                    Y
    SQL> insert into TEST_GLOBAL values (sysdate,sysdate,'test1');
    1 row created.
    SQL> select * from TEST_GLOBAL;
    STARTDATE ENDDATE   CLASS
    20-FEB-08 20-FEB-08 test1
    SQL> commit;
    Commit complete.
    SQL> select * from TEST_GLOBAL;
    no rows selected
    SQL>  select table_name,temporary from user_tables where table_name='TEST_GLOBAL';
    TABLE_NAME                     T
    TEST_GLOBAL                    Y
    SQL>

  • Question about temporary table population

    Hi ,
    I wrote a stored proc to populate a temp table inside a pacakage.
    I call that package in visual studio.
    As it's a temporary table , the table get deleted as soon as the session over .
    The Is there a way to c the table content ?
    PROCEDURE edr_class_by_hour_use_per_veh
       in_report_parameter_id   IN      report_tasks.report_task_id%TYPE
    IS
    BEGIN
      DELETE FROM edr_lane_by_class_report_data;
      INSERT INTO edr_lane_by_class_report_data
          site_id,
          site_lane_id,
          bin_start_date_time,
          v_class,
          v_lane,
          lane_count
      SELECT
              site_id,
              site_lane_id,
              bin_start_date_time,
              v_class,
              v_lane,
              COUNT(1)
        FROM (SELECT site_id,
                     site_lane_id,
                     ( SELECT NVL(MAX(interval_start_date_time), date_time)
                         FROM edr_rpt_tmp_grouping_table
                     WHERE interval_start_date_time <= date_time) bin_start_date_time,
                     NVL(traffic_class.v_class, 0) v_class,
                     NVL(traffic_record.lane, 0)   v_lane
                FROM edr_lane_by_class_per_veh_data
                LEFT OUTER JOIN traffic_class
                             ON traffic_class.record_id = edr_lane_by_class_per_veh_data.record_id
                LEFT OUTER JOIN traffic_record
                             ON traffic_record.record_id = edr_lane_by_class_per_veh_data.record_id             
              )vehicles
        GROUP BY site_id,
                 site_lane_id,
                 bin_start_date_time,
                 v_class,
                 v_lane;
    END edr_class_by_hour_use_per_veh;Edited by: Indhu Ram on Nov 25, 2009 12:29 PM

    Hi,
    You must have commited the rows for temporary sake with "on commit preserve rows"
    Refer to doc
    http://download.oracle.com/docs/cd/B10501_01/server.920/a96521/tables.htm#7832
    - Pavan Kumar N
    Oracle 9i/10g - OCP
    http://oracleinternals.blogspot.com/

  • Doubts about result table in endeca 3.1

    Hi All,
    I created the result table in Endeca 2.4 by using the checkbox for Use EQL query and entered the query but I cannot see the option of entering the eql in endeca 3.1.Has something changed or I have missed something?
    and In order to enable drill down  in endeca 2.4 I added an action column to pick the event ID available on a particular row. Clicked on Add Action Column button under Configuration tab and added teh action but cannot see samething in endeca 3.1.
    Can some one please let me know how can above things be achieved in endeca 3.1
    Thanks in Advance.

    In 3.1 for Results Table, you do not enter EQL. Instead, you set the table type to Analytics table, then add the metrics and dimensions. For simple metrics, you just add the attribute and select the aggregation method. For more complex metrics, you would need to add the metric as a predefined metric in the view. You could then add that metric to the table.
    Here's a link to the section of the Studio User's Guide that talks about configuring a Results Table:
    Configuring a Results Table
    And here's a link to general information about adding data to components in 3.1:
    Selecting and configuring the data displayed on a component

  • Small doubt(about pivot table)

    while creating a report i am getting error in Table view,if i create a same report in pivot view it is working fine in pivot view.
    after this i want to add this view to the compound view then i will have to delete the table view from the compound view .but while adding the pivot view to the compound view it is throwing error because by default compound view has only table view and tital view.it is not allowing me to add pivot view to the compound view.
    can anyone suggest me is there any other way i can add the pivot view to compoud view i want to view the title view and pivot view only in the compond view.(here the problem is i am unable to add pivot view to the compound view because error in the table view)

    Actually i placed couple of column in the excluded. now its working fine. i just want to know how can i add pivot tabler to the compound view at this situation

  • Doubt in Temporary table

    Used in procudure
    select c_1,c2........c_n
      from   t_temp_table
      where  t_id= 1270
    But, got the error...
    ORA-08103: object no longer exists
    After dropping and creation of table
    worked perfectly.
    What might have been the reason???

    Karthick_Arp
    I cannot understand your answer clearly Karthick.

  • Doubt about KONV table

    hi friends,
    i am selecting the sales order details and conditions from konv table but
    when i am checking the va03 my condition amount is 2.000%
    but in konv table it is 20.00 ,why is it so?
    how can i calculate it correctly?
    thanks & regards
    srinivas

    Yes it is you are using non primary key.. try to pass fiscal year and priod too .. you may get it bit faster.
    thanks
    mahesh

  • Doubt about FLASHBACK TABLE

    Dear Members,
    I am doing FLASHBACK TABLE as sys user. I know that FLASHBACK TABLE can not be used for user SYS ,
    still I successfully execute this command with to before drop clouse and
    when i execute this command with to timestamp clouse , I get error.
    Can some one please tell me why this is happening ?
    ORACLE : 11gR2
    OS : FEDORA 14
    $ sqlplus / as sysdba
    SQL> insert into t11 values('k');
    1 row created.
    SQL> !date;
    Wed May 30 15:45:13 IST 2012
    SQL> insert into t11 values('z');
    1 row created.
    SQL> drop table t11;
    Table dropped.
    SQL> select * from dba_recyclebin;
    OWNER               OBJECT_NAME          ORIGINAL_NAME          OPERATION TYPE               TS_NAME               CREATETIME     DROPTIME          DROPSCN PARTITION_NAME          CAN CAN     RELATED BASE_OBJECT PURGE_OBJECT SPACE
    SYS               BIN$wT5v1Gw96zbgQGSsOaoM4g==$0 T11               DROP     TABLE               NISHANT               2012-05-30:14:47:37 2012-05-30:15:45:36 17728226                    YES YES     85115 85115     85115     8
    SQL> flashback table "BIN$wT5v1Gw96zbgQGSsOaoM4g==$0" to timestamp to_time('30/05/2012 15:45:13','dd/mm/yyyy hh24:mi:ss');
    flashback table "BIN$wT5v1Gw96zbgQGSsOaoM4g==$0" to timestamp to_time('30/05/2012 15:45:13','dd/mm/yyyy hh24:mi:ss')
    ERROR at line 1:
    ORA-08185: Flashback not supported for user SYS
    SQL> flashback table "BIN$wT5v1Gw96zbgQGSsOaoM4g==$0" to before drop;
    Flashback complete.

    Hi,
    As far as i know, recyclebin doesn't work for SYS schema. The same i have tested on my 11.2.0.3 test database -
    18:12:22 SQL> select * from dba_recyclebin;
    no rows selected
    18:12:23 SQL> show user
    USER is "SYS"
    18:12:27 SQL>
    18:12:28 SQL> create table a (x number);
    Table created.
    18:12:35 SQL> insert into a values (1);
    1 row created.
    18:12:36 SQL> insert into a values (2);
    1 row created.
    18:12:36 SQL> insert into a values (3);
    1 row created.
    18:12:37 SQL> select * from a;
             X
             1
             2
             3
    18:12:38 SQL> commit;
    Commit complete.
    18:12:39 SQL> drop table a;
    Table dropped.
    18:12:46 SQL> select * from recyclebin;
    no rows selected
    18:12:48 SQL> select * from dba_recyclebin;
    no rows selected
    18:13:00 SQL>Can you please check back again.
    Edited by: Anand.. on May 30, 2012 6:19 PM --> Update --> It was my mistake, didn;t check the ts_name column. The object is created in non-system tablespace.

  • Doubt  about COEP table

    Hi ,
       I was looking at table COEP by objnr_n1 and kstar fields and found that it is taking almost 5 to 10mins to execute.
    Is it the general case with this table or is it only with my sap system.
    thx
    Raghu

    Yes it is you are using non primary key.. try to pass fiscal year and priod too .. you may get it bit faster.
    thanks
    mahesh

  • Doubts about a table.

    Hi guys , i have the follow.code  that a  friend of mine gave me  ,  but i ´ve never seen before code like this gs_hd-d-empresa, it has two hyphens !!! , how should I declare tp_header  ? is not declare in the code  anywhere. Is a special type of table ?
    DATA: gt_doc     TYPE TABLE OF zcmest_prvconf,
            gt_hd      TYPE TABLE OF tp_header,
            gs_hd      TYPE tp_header,
            lv_belnr   TYPE belnr_d,
            lv_gjahr   TYPE gjahr,
            lv_hkont   TYPE hkont,
            lv_bvorg   TYPE bvorg.
      SELECT  bkpf~bukrs     bkpf~belnr    bkpf~gjahr
              bkpf~blart     bkpf~budat    bkpf~cpudt
              bkpf~cputm     bkpf~xblnr    bkpf~bktxt
              bkpf~waers     bkpf~hwaer    bkpf~bvorg
              bkpf~xreversal bkpf~stgrd    bkpf~stblg
              bkpf~awkey
        INTO (gs_hd-d-empresa,   gs_hd-d-num_docsap, gs_hd-d-exercicio,
              gs_hd-d-tip_doc,   gs_hd-d-dt_lanc,    gs_hd-d-dt_dia,
              gs_hd-d-hr_ent,    gs_hd-d-ref_sap,    gs_hd-d-txt_cabdoc,
              gs_hd-d-moeda_doc, gs_hd-d-moeda_emp,  gs_hd-d-num_intemp,
              gs_hd-d-ind_est,   gs_hd-d-cod_est,    gs_hd-d-doc_est,
              gs_hd-awkey)
        FROM  bsis
        JOIN  bkpf
          ON  bkpf~bukrs = bsis~bukrs
         AND  bkpf~belnr = bsis~belnr
         AND  bkpf~gjahr = bsis~gjahr
    Thank you very much.

    Nested structure (not deep - deep means their a string or a table as a component)
    TYPES: BEGIN OF tp_header_type,
             BEGIN OF d,
               empresa TYPE ...
               num_docsap TYPE ...
            END OF d,
            awkey TYPE ...
          END OF tp_header_type.
    matt

  • Doubt with Global Temporary table

    hi,
    i have created a global temporary table with ON COMMIT DELETE ROWS option. in my Function in a loop i m inserting values into this Table, after that loop closes and then i m selecting some other values from DB. and in the last i am returning a ref cursor which is selecting values from temporary table i hav created.
    now the thing is i m not getting any values in the cursor.
    later I have created the table with ON COMMIT PRESERVE ROWS option, in this case cursor returning values,
    can anyone explain me the functionality, as per my knowledge global temporary table values are session specific so why i m not getting the values in the 1st case when i used ON COMMIT DELETE ROWS (same session).
    Thanks
    Piyush

    Ok, here's a simple example, like we'd like to see from you not working....
    First create a GTT with ON COMMIT DELETE ROWS...
    SQL> ed
    Wrote file afiedt.buf
      1* create global temporary table mytable (x number) on commit delete rows
    SQL> /
    Table created.Now a simple function that populates the GTT and returns a ref cursor to the data without doing any commits (hence the data should be there!)
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace function pop_table return sys_refcursor is
      2    v_rc sys_refcursor;
      3  begin
      4    insert into mytable
      5    select rownum from dual connect by rownum <= 10;
      6    OPEN v_rc FOR SELECT x FROM mytable;
      7    RETURN v_rc;
      8* end;
    SQL> /
    Function created.So now we call the function and get a reference to our ref cursor...
    SQL> var v_a refcursor;
    SQL> exec :v_a := pop_table();
    PL/SQL procedure successfully completed.So, in principle, because no commits have been issued the ref cursor should return data...
    SQL> print v_a;
             X
             1
             2
             3
             4
             5
             6
             7
             8
             9
            10
    10 rows selected.... which it does.
    Now, what happens if we do that again...
    SQL> commit;
    Commit complete.
    SQL> exec :v_a := pop_table();
    PL/SQL procedure successfully completed.... but this time we commit before retrieving the data...
    SQL> commit;
    Commit complete.
    SQL> print v_a;
    ERROR:
    ORA-00600: internal error code, arguments: [kcbz_check_objd_typ_1], [0], [0], [1], [], [], [], []
    no rows selected
    SQL>Oracle has (correctly) lost reference to the data because of the commit.
    So show us what yours is doing.

  • Is there a way to create "temporary" tables in SAP database?

    Hello,
    Is there a way to create temporary tables in ABAP?
    Here is our scenario:
    1. Invoke a custom RFC that creates a temporary table and returns the name of the table.
    2. Invoke another custom RFC and pass this table name as parameter. This RFC internally does some INNER JOIN with the temporary table.
    3. Invoke the third RFC to delete the temporary table.
    Note that the name of the table cannot be static. We have many users using our application simultaneously and connecting to the SAP server.
    I would appreciate it if you could point me in the right direction.
    Thank you in advance for your help.
    Peter

    I just ran into a similar issue.  While only calling the select statement 2 times, each time had so many entries in the 'for all entries' list, that the compiler converted this into about 700 calls to the select.  Now since the select joined three real tables on the database, the trace shows this one select as being the slowest item in this application.
    I think that happened because 'for all entries' gets converted to an 'IN' clause, and then the total number of characters in any SQL statement has an upper limit.   So the compiler must make the select statement over and over until it covers all entries in the 'for all entries' list.  Is that correct?
    Since every database I ever saw has the concept of db temporary tables, I have used db temp tables many times for this sort of thing.
    The ABAP compiler could determine that more than one IN statement will be need, then use an alternate: write all the FOR ALL ENTRIES to a db temp table, then join on the db temp table, then drop db temp table.  Since the compiler does this sort of thing, no application code needs change to get the speed boost.

  • How to use Temporary Table in PL-SQL

    In MySQL there is no Temporary table concept.
    So for intermediate calculation I have created a table as below
    create table SequenceTempTable
    SessionId VARCHAR(50),
    Sequence VARCHAR(500),
    CreatedDate DATE
    ) ENGINE=MEMORY;
    Whenever I invoke a SP, I load the data into SequenceTempTable using Session Id as below
    CREATE PROCEDURE `GetSequence`(
    IN Start_Date VARCHAR(25),
    IN End_Date VARCHAR(25)
    BEGIN
    SELECT UUID() INTO v_SessionId;
    INSERT INTO SequenceTempTable values (v_SessionId,'1,2,5,3',now());
    required code
    DELETE FROM SequenceTempTable WHERE SessionId = v_SessionId;
    COMMIT;
    END;
    i.e. I have created a table as temporary table (created once),
    and load the data using Session Id and once session specific intermediate computation done,
    I deleted the session specific data.
    Could you give me examples of How to use Temporary table in PL-SQL code with respect to my above example.
    Because I have gone through creating Temporary table but I stuck with use in PL-SQL. I mean to say Is there any need of creating table in advance before invoking SP.
    And one more thing as in MySQL temp table I created which is using MEMORY engine i.e. this table will always be in MEMORY so there is no need of writing data on disk.
    Regards
    Sanjeev

    Hi Sanjeev
    Read about GTT here
    http://www.oracle-base.com/articles/8i/TemporaryTables.php
    GTT always contains just session specific data. \
    In case you want to use the GTT in the same session again you can use option
    ON COMMIT PRESERVE ROWS;
    Or if it is used just once in the session use can use
    ON COMMIT DELETE ROWS;
    Do remember that for GTT the data of one session can not be accessed in other session.
    Also you can go away with Delete from GTT if not used again in same session.
    Regards
    Arun

  • Does Global Temporary Table help in performance?

    I have a large database table that is growing daily. The application I have has a page for the past day data and another for some chosen period of time. Since I'm looking at a very large amount of data for each page (~100k rows) and having charts based on time, I have performance issues. I tried collections for each of these and found out that it is making everything slower and I think because the collection is large and it is not indexed.
    Since I don't need the data to be maintained for the session and in fact for each time that I submit a page I need to get the updated data at least for the past day page, I wonder if Global Temporary Table is a good solution for me.
    The only reason I want to store the data in a table is to avoid running similar queries for different charts and reports. Is this a valid reason at all?
    If this is a good solution, can someone give me a hint on how to do this?
    Any help is appreciated.

    It all depends on how efficient your query is. You can have a billion row table and still get a fraction of a second response if the data is indexed, and the number of data blocks to be visited to retrieve the data is small. It's all about reducing the number of I/Os to find and retrieve your data with the query. Many aspects of the data, stats, table/index structure etc can influence the efficiency of your query. The SQL forum would be a better place to get into the query tuning, but if this test is fast, you can probably focus elsewhere for now. It will resolve your full resultset, and then just do a count of the result (to avoid sending 100k rows back to the client). We are trying to get an idea of how long it takes to resolve your resultset. Using litterals rather than item names in your sql should be fine for this test. Avoid using V() around item names in your SQL.
    select count(*) from ( <your-query-goes-here> );

  • 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

Maybe you are looking for

  • An error occurred while publishing file "/Web/Sites/iWeb/Jim and Steph's Si

    I'm guessing this is a common message most see when they try to publish their website. Reason I say this, is it is the only message I have recieved in the last week when trying to use this faulty software. Here it is again if you missed it: An error

  • SSRS Report - Group Totals are Zero when Group Row Hidden

    I have a report with one group called Counties. This group has a filter. I added code to produce the totals for Prior, Current and DistinctCount: Public Shared Dim grandTotal1 as Decimal = 0 Public Shared Dim CountyTotal1 as Decimal = 0 Public Functi

  • PS CC 2014 is slow tools like clone take forever

    How can I speed up PS CC 2014...will it help to uninstall PS CS6 and PS CC? Or can I purge the cache as we used to do?

  • Nokia 3600 slide has lost signal

    Hi My mobile (nokia 3600 slide) has lost signal, what is the solution ? please Moderator's note: The title changed as the post was moved from another thread.

  • Discovering the Design Behind Legacy Code

    Hi all, There are lots of tools and utilities out there to help us design good code, and lots of design patterns and good methodologies for us to follow. However, when you're looking at legacy code, is there any "standard" way of trying to work out w