HELP global temporary table ----URGENT

HI ALL,
create global temporary table FLIGHT_SCHEDULE ( STARTDATE DATE, ENDDATE DATE, COST NUMBER ) on commit preserve rows;
I a not able to get return value in cursor
but if this table is normal i.e. not temprary then it is returnng cursor
ORA-24338 statment handel not exucuted error comming
Please help
Regards

The code you posted looks alright.
Perhaps you did not post the code with the problem?

Similar Messages

  • 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> );

  • Need help with global temporary table

    Can anyone please help, the following line of code :
    CREATE GLOBAL TEMPORARY TABLE tbl_bulknodes_temp ( obt_uuid VARCHAR2 ) ON COMMIT DELETE ROWS
    Yeilds the following error both in PL/SQL and running it in SQL PLUS
    Error starting at line 1 in command:
    CREATE GLOBAL TEMPORARY TABLE tbl_bulknodes_temp ( obt_uuid VARCHAR2 ) ON COMMIT DELETE ROWS
    Error report:
    SQL Error: ORA-00906: missing left parenthesis

    Hi,
    You have to put length to 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> Regards,

  • Use of global temporary tables in Procedures

    Hi
    I am using global temporary tables in the procedures. Loading data in the same table through many procedures. I am fetching the data from the global temporary table in PRO-C by a cursor. Will this degrade performance?
    Please help me..
    Thanks in Advance...

    Will this degrade performance?That depends... in comparison to what?
    Loading data into temporary tables will generally be more efficient than loading data into permanent tables because Oracle needs to do less to protect this data since it is inherently transient. On the other hand, loading the data into a table in the first place tends to be more expensive than alternatives like using a single SQL statement, a pipelined table function, or an in memory collection.
    Justin

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

  • 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

  • Global Temporary Tables in active data guard.

    HI Gurus,
    Please help me with below query. Google confusing me a lot.
    1) We have an ADG (RAC Setup) 11gr2 with ASM. Is it possible to create global temporary tables in ADG. Because Devlopers are not able to create temp tables. Its giving error as
    ORA-16000: database open for read-only access
    2) Do we need to create Global Temporary tables in Active node or passive node??
    Please help.
    Regards,
    Nikhil Mehta.

    Hi Meser,
    thanks for your response.
    We are using it for Reporting purpose only.
    SQL> select open_mode from v$database;
    OPEN_MODE
    READ ONLY WITH APPLY
    Regards,
    Nikhil Mehta.

  • Global temporary table

    Hi
    how to create global temporary table and push data from forms.
    Thanks
    Shital

    hi
    try something like this.
    CREATE GLOBAL TEMPORARY TABLE my_temp_table (
      column1  NUMBER,
      column2  NUMBER
    ) ON COMMIT DELETE ROWS;If its Correct/Helpful please Mark it thanks.
    Sarah

  • Problem with Temporary Table (Urgent)

    Hi all,
    Yesterday also i was facing da problem of gettin records from a global temporary table .. Today also i made a procedure in which i have to create a temporary table according to da select query ..and when i m printing da count(*) from tht table .. result is 0 tht means records r not inserting ..
    But if i m creatin it as a normal Create Table i m gettin da result..
    I want the table shud b created n records fetch by the query shud b inserted.. I have checked query is fetchin records..
    Sorri but still da same proble .. pls help me out
    PROCEDURE prn_trnASRGetStudentCertInfo(strIntakeSession          IN sisStudent.IntakeSession          %TYPE,      
                             strProgramCode          IN sisStudent.ProgramCode          %TYPE)
         AS
         intCount Number(3);
         SQLSTR     varchar2(100);     
         BEGIN
              EXECUTE IMMEDIATE 'CREATE GLOBAL TEMPORARY TABLE tmpStudentCert
                        AS
                        SELECT     sisEnrolment.EnrolmentID     As EnrolmentID,     
                                  sisEnrolment.StudentID          As StudentID,
                                  sisEnrolment.ProgramCode     As PrgCode,
                                  sisCourseEnrolled.CourseCode     As CourseCode,
                                  sisCourseEnrolled.Status     As Status,
                                  exmCCResult.Status           As exmStatus     
                        FROM          sisStudent
                        INNER JOIN sisEnrolment
                        ON
                             sisStudent.StudentID = sisEnrolment.StudentID
                        INNER JOIN sisCourseEnrolled
                        ON
                             sisEnrolment.EnrolmentID = sisCourseEnrolled.EnrolmentID
                        INNER JOIN exmCCResult
                        ON
                             sisCourseEnrolled.CourseCode =      exmCCResult.CourseCode
                        AND
                             sisCourseEnrolled.ProgramCode = exmCCResult.ProgramCode     
                        WHERE
                             UPPER(TRIM(sisStudent.IntakeSession)) = UPPER(TRIM('''||strIntakeSession||'''))
                        AND
                             UPPER(TRIM(sisStudent.ProgramCode)) = UPPER(TRIM('''||strProgramCode||'''))
                        AND
                             UPPER(TRIM(sisCourseEnrolled.Status)) <> TRIM(''D'')
                        AND
                             UPPER(TRIM(exmCCResult.Status)) = TRIM(''P'')';
              COMMIT;     
              SQLSTR := 'SELECT COUNT(*) FROM TMPSTUDENTCERT';
              EXECUTE IMMEDIATE SQLSTR INTO INTCOUNT;
              dbms_OUTPUT.PUT_LINE(INTCOUNT);
         END prn_trnASRGetStudentCertInfo;

    Hi there,
    You have had quite a few replies from the previous post and you should have learnt from that.
    Creating a procedure to do what you are trying to do is logically not sound.
    Firstly, a Global temporary table IS a database object which continous to exist like a normal table except that its data is not permanent. Therefore, there is no point in creating it dynamically in a procedure.
    Secondly, as I pointed out earlier, the data is temporary and it is gone once you issue a commit. A DDL like 'Create Table' will implicitly issue a commit after it has created the table - therefore all the data inserted as part of the Create Table statement will never be there.
    Hence, the subsequent SELECT COUNT(*) from the table will always return 0.
    Regards,
    John

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

  • Using Global Temporary Table in OBIEE 11

    Hi,
    THe requirement is to run a database function before the report runs. This Function accepts 5 parameters (Presentation Variable) and populates a GTT Global Temporary Table.
    This GTT is configured in presentation Layer.
    Issue:
    1. Created a dummy report which returns only one row and called the fucntion using "Evaluate" in this.
    2. Created 2nd report using GTT Columns.
    All these 2 reports placed on dashboard and Presentation variable are set in the prompt. The first one runs correctly and populate the "Regular Table". Means when I create a regular table instead of GTT I can see the correct record. But if I change it to GTT then the data does not get populated in this table.
    Any Inputs?
    Regards

    HI,
    If you are using a GTT, you need to run the function which populates the GTT before OBI server executes the select query on that table.
    In your case, the OBI server is executing the select query from the table before the data is populated in the table.
    In order to force the BI server to run the query after the GTT is populated, you need to specify the condition in the connection pool settings under the connection scripts tab.
    In the execute before query, enter your physical query which runs the function to populate the GTT.
    Hope this helps !
    Thanks,
    Vineeth

  • Performance slow on DELETE command on global temporary table!

    Hi,
    I have a delete on a global temporary table that is taking long time!.
    Anyone have a clue about how to improve delete command's against global temporary table??
    Tks,
    Paulo Portugal

    Same problem here!
    <QUOTE>
    SELECT DISTINCT PDT_CHILD.SUP_ID, PDT_CHILD.SUB_ID,
    PDT_CHILD.SUB_LEAF_FLAG_ID
    FROM
    PJI_FP_AGGR_RBS_T PDT_CHILD WHERE 1=1 AND PDT_CHILD.SUP_ID = :B2 AND
    PDT_CHILD.SUP_ID <> PDT_CHILD.SUB_ID AND PDT_CHILD.WORKER_ID = :B1
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 88561 20.71 20.23 0 0 0 0
    Fetch 90269 926.19 906.80 45 45164134 0 176545
    total 178831 946.91 927.03 45 45164134 0 176545
    Misses in library cache during parse: 0
    Optimizer mode: ALL_ROWS
    Parsing user id: 173 (APPS) (recursive depth: 1)
    Rows Execution Plan
    0 SELECT STATEMENT MODE: ALL_ROWS
    0 HASH (UNIQUE)
    0 TABLE ACCESS (FULL) OF 'PJI_FP_AGGR_RBS_T' (TABLE (TEMP))
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    latch: row cache objects 1 0.00 0.00
    direct path write temp 3 0.00 0.00
    direct path read temp 3 0.00 0.00
    </QUOTE>
    The fetch is too high for TEMP table... Any help would be much appreciated!
    Note: Please teach me on how we can format the above in my future posts in OTN forums.
    ===

  • 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

  • Global Temporary Table not deleting Rows

    why is my Global temp table not deleting the rows after commit see below,
    CREATE GLOBAL TEMPORARY T_CHG
    TBE VARCHAR2(7),
    ABC VARCHAR2(8),
    EFDA VARCHAR2(6),
    ABD VARCHAR2(9),
    A_ID VARCHAR2(128),
    C_DATE,
    ON COMMIT DELETE ROWS;

    Quite a few syntax issues with your create statement. It would have helped if you had posted a SQL*Plus session showing your results. Here is mine which works just fine:
    sql>create global temporary table t_chg
      2  (
      3  tbe varchar2(7),
      4  abc varchar2(8),
      5  efda varchar2(6),
      6  abd varchar2(9),
      7  a_id varchar2(128),
      8  c_date date
      9  )
    10  on commit delete rows;
    Table created.
    sql>insert into t_chg values ('1', '2', '3', '4', '5', sysdate);
    1 row created.
    sql>select count(*) from t_chg;
    COUNT(*)
            1
    1 row selected.
    sql>commit;
    Commit complete.
    sql>select count(*) from t_chg;
    COUNT(*)
            0
    1 row selected.

  • Datas deletion from Global Temporary table  when clear command is given

    Dear All,
    How to Delete datas from global temporary Table when clear command is given in forms
    Suggest me syntax..
    Pls help..
    Regards,
    Gokul.B

    http://psoug.org/reference/gtt.html
    Francois

Maybe you are looking for

  • No sync instructions appear when I plug in my new Shuffle

    I just purchased an IPod Shuffle and I plugged it in to my computer with ITunes open.  Nothing happens. No instructions pop up to sync the new shuffle. What is wrong?

  • Integrate workshop 10 with integration server 9.2

    Hi All Can anyone please tell me whether it is possible to integrate Workshop 10.0 with integration server 9.2? If possible how can it be done? I am using the Weblogic server 10, so all the components i.e portal and workshop are the latest version. o

  • Backing up an HD on another computer

    I have 2 macbook pros. One is 2009, one 2013. The 2013 one doesn't recognise the HD on start up. Having run a few diagnostics I have now put the HD from the broken 2013 macbook into the 2009 one. It works! So, it's the HD cable. Good. But whilst it i

  • Imac crashes when i try to start itunes...all other programs are working fine....help !!!

    imac crashes when i try to start itunes.... have updated everything...still crashes...please help...

  • Account Customer Address

    Hi, I am new to Siebel, and I am having some difficulties with devloping correclty a pickapplet for picking Addresses for a user. The requierment is basically this: 1) make a pick applet that assigns the pick address to the Primary Account Address fi