Problems with Global Temparory Table

{color:#0000ff}Hi,{color}
{color:#0000ff}
We are using Global Temporary tables in Store proc's.{color}
{color:#0000ff}
Created GTT Table with preserve rows on commit.{color}
{color:#0000ff}
we are inserting data into GTT using "Insert into Select" statement. The problem is GTT is not returning all the records. That is First run records count is 2176. After running consecutively 4 times, the record count is 49.
we are not able to find the exact reason.
Please let us know the reason and resolution for this issue.{color}

I am not sure what type of GTT you have "COMMIT DELETE ROWS" or "COMMIT PRESERVE ROWS". I am guessing here, that you have GTT of "COMMIT DELETE ROWS". In this case once you have done the inserted and comitted then you will not see the record that you have just inserted. You can only see the record if you have not comitted.
I think the procedure at first does inserts 2176 rows but the data is erased due to commit. And you see the last insert of 49 rows because you have not commited yet.
If this is not the case then kindly post he script you are using. Regards

Similar Messages

  • Problem with global temporary table in Oracle 10g

    Hi All,
    I face a peculiar problem in Oracle 10g with respect to Global temporary table.
    Have Oracle 10g version in Production and 11g version in UAT.
    Table_
    create global temporary table TT_TEMPGPSMANUAL
      Col_1    VARCHAR2(50),
      Col_2    VARCHAR2(500),
      Col_3    VARCHAR2(50),
      Col_4    VARCHAR2(50),
      Col_5    VARCHAR2(15),
      Col_6    VARCHAR2(20),
      Col_7    VARCHAR2(250),
      Col_8    VARCHAR2(20),
      Col_9    VARCHAR2(15),
      Col_10   VARCHAR2(20),
      Flag     NUMBER,
      Col_11   INTEGER,
      Col_12   VARCHAR2(50)
    on commit preserve rows;So this should preserve the rows inserted into this table until the session ends.
    Have a webpage in front-end where in turn, it opens another page (session is carried through) and a few rows will be inserted to this table from the webpage (through a function) on submit and the current page will be closed.
    From the parent page, if I open the sub-page data inserted in the temporary table are held and displayed (another function to fetch the values in the Global Temp table).
    The Problem in Oracle 10g (Production) is, this is not happening properly. When I close and open the sub-page, not every time I get the data stored i.e if I close and open the page 10 times, atelast 4 times the data is missed in the page (I am not getting values from temp table) randomly.
    But this does not happen in UAT (which has Oracle 11g installed) as I get the data in the webpage consistently. After passing UAT, when we rolled out to Prod, getting this issue which we are unable to get what could be the reason.
    It is very hard to debug using GTT dynamically in prod. It takes time to get Oracle 11g installed in Prod.
    Can anyone suggest?
    Regards
    Deep

    935195 wrote:
    Also, I am opening the sub-page from the parent page (through a hyperlink). Then in this case, Would session will be changed from parent to subpage? (I am not aware exactly and have the impression that, as the second page is a child, I guess it would take the same session).I'm not sure what "sub-page" or "parent page" means to you. If you're just linking from one page to another, "parent" and "child" don't really make sense since page A links to page B and B links to A quite frequently.
    Assuming that you have to log in to access the site, it is likely that the two pages share the same middle tier application session. It is unlikely that the middle tier would hold the database session from the first request open waiting to see if the user eventually requested the second page. It is theoretically possible that you could code your middle tier this way but it is extremely unlikely that you would want to do so for a variety of reasons. So, when you say "would [the] session ... be changed", it is likely that the application session would be the same for both calls but that the database session would be different.
    Justin

  • Problem with global temporary table with rows

    Scenario :
    I need to create a table for generating a report in a oracle 10g database. Data population in the table depends on the parameter passed from front end.
    I have created global temporay table to achieve this. But use of same table by another user is not possible.
    I have created the global temporary table as follows:
    ''Create global temporay table xyz (a varchar2(10),b varchar2(10)) on commit preserve rows''

    You have not posted much details.
    But yes, global temporary tables are session specific. So other session won't see anything.
    Amardeep Sidhu
    http://amardeepsidhu.com/blog
    http://oracleadmins.wordpress.com

  • Problem with GLOBAL TEMPORARY TABLE  into SP

    im trying to create a temporary table into a sp but it show me an error , this is the store
    CREATE OR REPLACE PROCEDURE sp_sample IS
    BEGIN
    CREATE GLOBAL TEMPORARY TABLE tmp_datos_entrada
    ON COMMIT DELETE ROWS AS
         Select * from Customer where NAME = 'LOPEZ';
    END sp_sample

    Hi,
    You can't execute DDL directly in PL/SQL, it's not supported.
    You can, however, use Native Dynamic SQL to do this in the following manner:
    begin
       execute immediate 'create table t(x int)';
    end;You will need to use the autonomous_transaction pragma to maintain transactional integrity.
    But you may want to think about WHY you are doing this in a SP. You should probably just create the global temporary table as a permanent database object. It's refreshed on commit anyway -- I think you're missing the point slightly.
    cheers,
    Anthony

  • Problem with checkbox on table component

    Hello i am having a problem with checkbox in table component
    i am developing something like a shopping cart app and i have a checkbox in my table component , i want users to select items from the checkbox to add to thier cart, They can select the items from cartegory combobox , my problem is when they select the items from the checkbox if they select another category the alread selected once do not display in my collection opbject please how can i maintain the state of the already selected items in my collection object

    Hi,
    Please go through the tutorial "Understanding scope and managed beans". This is available at:
    http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/scopes.html
    The details of the selected items need to be stored in an object that is in session scope.
    Hope this helps
    Cheers
    Girish

  • Transaction with Global Temporary Table

    Problem:
    Transaction starts with few DML statements and in the middle we are calling a JAVA method which creates the dynamic global temporary table and proceeding with few DML statements, if one of the statement fails, in the exception clause we are trying to rollback and transactions after the DDL (create global temp table) are rolled back and transactions before the DDL (create global temp table) are committed.
    We cannot pre-create the global temporary table, since we do not know the number of temp table to be pre-created.
    How we can resolve this issue? The same concept works for SQL server.
    Example of our issue:
    --drop table table1 purge;
    --drop table t_id purge;
    Create table table1 (col1 number, col2 varchar2(20));
    Insert into table1 values (1, 'Test1');
    Create global temporary table t_id (id number);
    Insert into table1 values (2, 'Test2');
    Rollback;
    After the rollback you can see only the 'Test1' record.

    > We cannot pre-create the global temporary table, since we do not know the number of temp table to be pre-created.
    I don't see how one procedure could need to create an unknown number of temporary tables. Do they all have different (and unknown) column lists? Couldn't you combine them into a single table with a key to distinguish betweeen the different sets of rows?

  • Problems with calculation in table footer

    I’m working on a 'dynamic form’ with an expandable table (i.e. the user presses a button to add a new row), there are cells in each row for beginning month & ending month, plus an autocalc total field containing the formula: “ending – beginning +1” (which accurately calculates total months e.g. Jan-Dec = 12 months). There is also a ‘total months’ field in the footer which sums the row ‘total’ cells. The problem I have is that the user could add a blank row throwing off the total cell in the footer. Any suggestions to accomplish my goal of presenting accurate total in footer while ‘idiot proofing’ the form?

    A link to the your live test page would be much more productive here. 
    It's much easier for us to diagnose problems when we can see your page & images in our browsers.
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/
    http://twitter.com/altweb

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

  • Problem with loading fact table in OWB3i

    Hi,
    I have a problem while trying to load a fact table using OWB 3i. Let me explain the situation :
    I have 2 dimensions: Customer, Product say.
    I have loaded the dimension tables separately, successfully using different mappings from source tables.
    Now I want to load the fact table with the corresponding warehouse keys from these dimension tables through lookup transformation.
    When I try to bring to lookup transformations for the 2 dim. tables, it gives an error--"Source and target are bound to different data providers". Using 1 dim table and 1 corresponding lookup transformation , the fact table is successfully loaded.
    How to load a fact table when there are more than 1 dim. tables using lookup ?Is there any other way of solving the same problem?
    Any suggestion will be highly appreciated.
    regards
    Dipanjan

    Simply, try joining source tables with the join operator. In wich way you can create a single source object into the mapping suitable to be connected with yours fact tables.
    Greetings

  • Problems with Java Dictionary Tables

    Hi Experts,
    I have some problems with the Java Dictionary tables that I have created for my
    application. There are around 15 dictionary tables, each one of them having
    several hundred records, added in due course.
    As much as I understand these tables (created using the dictionary perspective)
    are stored in the default schema of the J2EE engine where the dictionary project
    is deployed and there is no direct way to insert records into these tables, we have
    to separately write methods to insert, update and delete records.
    I've already done this. Now the problem is that i have moved my project DC from
    development to testing. Now here the tables are existing, but not the data that i
    inserted during development.
    NOW, the main question: IS THERE ANY WAY IN WHICH I CAN TRANSFER
    THE CONTENTS OF THESE JAVA DICTIONARY TABLES??
    I have tried solutions like creating a DBLINK between the databases, but it is
    tedious, and unpredictable in behaviour. Also Please do not advise to first
    download them to excel and then upload using jxlapi, etc.
    Thanx in Advance.
    Alka.

    Hi Alka,
    The dblink is a good solution, but just a bit slow. You can also use a SQL Loader, first export the data from the source table in a text file (i.e. using a tool like TOAD), then sql loader loads the data in the destination table. This is more fast.
    Hope this help,
    Vito

  • Problem with sap script table in main window

    hi all,
    i have created a sap script  for which output is in 7 pages.
    except first page all the remaining pages are giving the correct output.
    the problem with the first page is iam not not getting vertical lines in the table which is in the main window of page 1.
    iam getting the vertical lines correctly in the mainwindow table of all the remaining pages.

    Hi,
    It's simple,
    Pre- U should had declared a second page for the same window with header, main & footer.
    now
    First when u r looping the internal table provide no of rows eg Row 1 TO 10. in the Loop ( Data Tab)
    or
    when defing TEXT Go to PC Editor and mention all the fields Under  PROTECT -  ENDPROTECT.
    This would solve the issue.
    Thanks
    Ravi

  • Problem with DB6CONV online table move

    Hello,
    I tried to schedule a few concurrent online table move using DB6CONV (version 4.08, on NW07 SP17, DB2 9.5), and I got the error message below in two of the table move sessions:
    20090917 174517 ONLINE CONVERSION: Start of Step 1 (INIT)
    20090917 174517 CALL SAPTOOLS.ONLINE_TABLE_MOVE( 'SAPBD1', '/BIC/AZGL_D00600',
                      'BD1#ZDGLAD', 'BD1#ZDGLAI', '', '', '', 'INIT' )
    20090917 174518 ONLINE_TABLE_MOVE - INIT step aborted.
    20090917 174518 SQL0443N  Routine "*BLE_MOVE" (specific name "") has returned an error
                      SQLSTATE with diagnostic text "SQL0624N  Table
                      "SAPTOOLS.ONLINE_TABLE_MOVE" already has a ".  SQLSTATE=42889
    20090917 174518 Step 1 aborted with errors
    I then chose "Continue" on one session alone, it completed successfully.
    If this is a problem when running DB6CONV online table move in parallel? Is there any way to fix this problem?
    Thanks,
    Patrick

    Hi Siegfried,
    My trace file will excee the maximum 15000 characters allowed in this forum. If you like I can send you in the email.
    With a single table move, it will not fail. So the trace file below showed a successful init step:
    13286: entry: SQLT_db2sap_online_table_move     "SAPBD1"        "/BIC/B0001321000"      "INIT,TRACE"
      838: entry: SQLT_db2sap_Otm_constructor       fffffffffff5c40
        145: entry: SQLT_db2sap_StoredProcedure_connect     fffffffffff5c40
        172: exit:  SQLT_db2sap_StoredProcedure_connect=0
        113: entry: SQLT_db2sap_StoredProcedure_initVersion fffffffffff5c40
          130: SQLT_db2sap_StoredProcedure_initVersion      "driverVer"     "09.05.0002"
        136: exit:  SQLT_db2sap_StoredProcedure_initVersion=0       true    true
        877: SQLT_db2sap_Otm_constructor    "indexNameSz"   128
        880: SQLT_db2sap_Otm_constructor    "triggerNameSz" 128
      883: exit:  SQLT_db2sap_Otm_constructor=0
      2951: entry: SQLT_db2sap_Otm_getProtocolEntryAsInt    "TRACE" fffffffffff5c40 true    0
        2921: entry: SQLT_db2sap_Otm_getProtocolEntry       "TRACE" fffffffffff5138 129     fffffffffff5c40 true    "<null
    >"
          2847: entry: SQLT_db2sap_Otm_getProtocolEntry     "SAPBD1"        "/BIC/B0001321000"      "TRACE" fffffffffff513
    8       129     fffffffffff5c40
            305: entry: SQLT_db2sap_StoredProcedure_prepare "SELECT COALESCE(value, longvalue) AS VALUE FROM SAPTOOLS.ONLI
    NE_TABLE_MOVE WHERE tabschema = ? and tabname = ? and key = ? OPTIMIZE FOR 1 ROW"       fffffffffff5c40 false
            323: exit:  SQLT_db2sap_StoredProcedure_prepare=0
            2890: SQLT_db2sap_HANDLE_SQLCA  -100014
          2903: exit:  SQLT_db2sap_Otm_getProtocolEntry=-100014     ""
          2847: entry: SQLT_db2sap_Otm_getProtocolEntry     ""      ""      "TRACE" fffffffffff5138 129     fffffffffff5c4
    0
            2890: SQLT_db2sap_HANDLE_SQLCA  -100014
          2903: exit:  SQLT_db2sap_Otm_getProtocolEntry=-100014     ""
          2940: SQLT_db2sap_HANDLE_SQLCA    -100014
        2943: exit:  SQLT_db2sap_Otm_getProtocolEntry=-100014       ""
      2981: exit:  SQLT_db2sap_Otm_getProtocolEntryAsInt=0  0
      3469: entry: SQLT_db2sap_Otm_setLock  fffffffffff5c40
        2921: entry: SQLT_db2sap_Otm_getProtocolEntry       "LOCK"  fffffffffff50d8 129     fffffffffff5c40 false   ""
          2847: entry: SQLT_db2sap_Otm_getProtocolEntry     "SAPBD1"        "/BIC/B0001321000"      "LOCK"  fffffffffff50d
    8       129     fffffffffff5c40
            2890: SQLT_db2sap_HANDLE_SQLCA  -100014
          2903: exit:  SQLT_db2sap_Otm_getProtocolEntry=-100014     ""
        2943: exit:  SQLT_db2sap_Otm_getProtocolEntry=0     ""
        2993: entry: SQLT_db2sap_Otm_protocolTime   "LOCK"  fffffffffff5c40
          305: entry: SQLT_db2sap_StoredProcedure_prepare   "MERGE INTO SAPTOOLS.ONLINE_TABLE_MOVE AS t USING TABLE
      323: exit:  SQLT_db2sap_StoredProcedure_prepare=0
      922: entry: SQLT_db2sap_Otm_destroy   110029290       fffffffffff5c40
        3522: entry: SQLT_db2sap_Otm_releaseLock    fffffffffff5c40
        3536: exit:  SQLT_db2sap_Otm_releaseLock=0
        770: entry: SQLT_db2sap_Otm_deinitReplay    fffffffffff5c40
        788: exit:  SQLT_db2sap_Otm_deinitReplay=0
        181: entry: SQLT_db2sap_StoredProcedure_disconnect  fffffffffff5c40
        260: exit:  SQLT_db2sap_StoredProcedure_disconnect=0
        648: entry: SQLT_db2sap_StmtPool_destructor
          649: SQLT_db2sap_StmtPool_destructor      2
        654: exit:  SQLT_db2sap_StmtPool_destructor=0
        181: entry: SQLT_db2sap_StoredProcedure_disconnect  fffffffffff5148
        260: exit:  SQLT_db2sap_StoredProcedure_disconnect=0
      997: exit:  SQLT_db2sap_Otm_destroy=0
    13634: exit:  SQLT_db2sap_online_table_move=0   "00000" ""

  • Select distinct problem with muliple join tables, help needed

    Hi,
    I have two main tables. Each has its of sub joined tables.
    guest_id_for_reservation connects two major tables. This has
    to be that way
    because my guest may change the room status from single to
    double (and the
    similar exceptional requests).
    guests reservation
    guest_id_for_reservation
    countrytable hoteltable
    delegationtable roomtype
    I form a query. I want to select distinct those results. But
    it does not
    work.
    If I do not include any table related to reservation table
    and its sub
    joined tables (disregarding guest_id_for_reservation), it
    works.
    Is there a specific syntax for select distinct of this type
    or any
    workaround.?
    Thank you
    Hakan

    Hi I'm still battling with this - have connected the AX to my Imac via ethernet and it shows up fine in Airport Utility. Status light is green and it says its set up to connect to my existing wireless network using wireless connection. Security in Network Preferences is the same for both: WPA2 Personal.
    So I don't think there's a problem with the AX, and my current wireless network (BT Home Hub) is working fine.
    And when I restore factory settings Airport Utility can see the AX before updating settings so the wireless side of AX must work too.
    I'm figuring it must be something about the settings that mean AU can't see it anymore. But I can't work out what, since security is the same.
    Any ideas would be great!

  • Direct Path Loading Issues with Global Temporary Tables - OCI & OCILib

    I am writing some code to import data into a warehouse from a CPU grid which computes risk data. Due to the fact a computing grid is used there will be many clients which can load the data concurrently and at any point in time.
    Currently the import uses Binding in OCCI and chunking with a prepared statement to import the data into a global temporary table in a staging area after which a stored procedure is called within the same session which will process the data and load the data into a star schema.
    The GTT has the advantage that if any clients have issues no dirty data will be left and each client only sees their own instance of the data.
    I have been looking at using direct path loading to increase the performance of the load and have written some OCI code to perform the same task. I have manged to import the data into a regular heap based table using the OCI direct path apis. However when I try and use the same code to import against a Global Temporary Table I get an OCI Error (ORA-00600: internal error code, arguments: [6979], [16], [1], [1318528], [], [], [], [], [], [], [], [])
    I get error when the function OCIDirPathPrepare is executed. The same issue occurs in both OCI and OCILib.
    Is it not possible to use Direct Path Loading against a Global Temporry Table ? Because you can use the /*+ APPEND */ hint and load global temporary tables this way from tools like SQL Devloper / toad which is surely informing the SQL Engine to use Direct Path ?
    Looking at the table USER_OBJECTS I can see that for a Global Temporary Table the DATA_OBJECT_ID is null. Does this mean that it is impossible to us a direct path load into Global Temporary Tables ?
    Any ideas / suggestions would be really appreciated. If this means redesigning the application then I would appreciate suggestions which would allow many client to quick write processes in a parallel fashion. If this means creating a new parition in a Heap Table for each writer and direct path loading into this table then so be it.
    Thanks
    H
    Edited by: 813640 on 19-Nov-2010 11:08

    Replying to my own message in case anyone else is interested.
    I have now managed to successfully load data using direct path into a global temporary table with OCI. There appears to be no reason why this approach will not work.
    I loaded data into the temporary table and then issued a select count(*) on the table from within the session and from a new session. The results were as expected.
    The resaon for the ORA-006000 error was due to the fact that I had enabled table level parallel loading
    ie
    OCIAttrSet((dvoid *) context, (ub4) OCI_HTYPE_DIRPATH_CTX, *(ub1) 1*, (ub4)0, (ub4) OCI_ATTR_DIRPATH_PARALLEL, errhp)
    When loading a Global Temporary Table the OCI_ATTR_DIRPATH_PARALLEL attribute needs to be zero
    This makes sense, since the temp table does not have any partitions so it would not be possible to write in parallel to multiple paritions.
    Edited by: 813640 on 22-Nov-2010 08:42

  • Problem with saving duplicated tables in interactive form

    Hi,
    I have an interactive form that contain a table with a row that contain "insert remove move " object .
    when i press the add button, it duplicate the table, but if i save the PDF and then open it again, the extra table does not appear,
    it seems like it never been save.
    do you knoe what is the problem? why the tables are not saved properly?
    thanks, Noa

    Hi,
    Try doing the following
    try using the simple 'Button'. In the button's object properties, in the tab named 'field', select 'Control Type: submit'.
    Then, in the 'submit' tab in the object properties, choose PDF in the 'submit format' dropdown field.
    In the 'submit to URL field' type:
    mailto:nameataddress.com?subject=mySubject&body=Done
    You may need to adjust the e-mail address, subject and body text.
    Regards
    Ayyapparaj

Maybe you are looking for