Can you SELECT INTO a temporary table?

I was wondering if you can do this and what the syntax would be. I tried to SELECT INTO GLOBAL TEMPORARY TABLE and it didn't work.

If you are looking to Create a GTT, load data into it and then be able to select from the GTT after createion, you'll need to remember to preserve the rows after a commit e.g.:
create global temporary table gtemp on commit preserve rows as select * from tab;
However, your question is a bit on the vague side as to EXACTLY what you are wanting to do.
As an addendum
It didn't work is a completely useless statement without telling us how you know it didn't work
Message was edited by:
JS1

Similar Messages

  • Transaction data can be loaded into the Fact table without loading the

    Transaction data can be loaded into the Fact table without loading the corresponding master data (Example : Sales analysis transaction data can be loaded without populating any of its  dimension’s master data)
    a.     True
    b.     False

    Hi Kutti,
    True - You need to select the option in the infopackage - alwyas load even if no master data exists.
    Bye
    Dinesh

  • Is there a preferred format of XML that can be laoded into an Oracle table?

    XML files vary quite a bit. From mere fragments to file carrying schema, etc. What is the preferred format of an XML file that can be loaded into an Oracle table assuming that the Schema agrees with the table structure.
    It does not seem to load an XML file even with W3C namespace and all.
    Krishnaswamy Jayaram

    With XE there is XML support in the database but no XQuery, JNDI, or Servlet support.
    If you give a specific example it could be helpful, here are simple write and read tests on XE;
    HR on 20/03/2006 10:28:22 at XE > CREATE TABLE xml_tab (xmlval XMLTYPE);
    Table created.
    HR on 20/03/2006 10:28:31 at XE > INSERT INTO xml_tab VALUES (
    2 XMLTYPE.CREATEXML(’
    3
    4 221
    5 John
    6 ‘));
    1 row created.
    HR on 20/03/2006 10:28:41 at XE > INSERT INTO xml_tab VALUES (
    2 XMLTYPE.CREATEXML(’
    3
    4 331
    5 PO_1
    6 ‘));
    1 row created.
    HR on 20/03/2006 10:28:49 at XE > select x.xmlval.getstringval() from xml_tab x;
    X.XMLVAL.GETSTRINGVAL()
    221
    John
    331
    PO_1

  • Sql/Plsql code to export data into a temporary table from a text file

    Dear all,
    I need to create a temporary table getting data from a text file. I am very new to data loading could you please help me how to read the text file in to a temporary table.
    i have text file like as below:
    order items : books Purchasing
    start date:
    8-11-09
    Notes: Books are selling from aug10 to aug 25
    Action performed
    Time
    Verified By
    sold out from shop, sold out date:_________
    1.
    physics _______ book sold to ravi
    2.
    social _______ book this is a good book
    sold to kiran
    aug10th
    ronald
    3.
    maths book to sal
    4.
    english book__________ this was a newbook
    to raj
    jak
    return to shop, return date:____________
    1.
    maths book return by:_____________ Verify book
    aug11th
    john
    2.
    story book by:_________ checked
    aug14th
    Now i need to create a temporary table and insert the data into the table from this text file.
    Now i need to create a temporary table named as books_order with 5columns(order,Status,Action_Performed,Time,Verified_By) like as below:
    Order     status     Action_Performed     Time     Verified_By
    books Purchasing     sold     physics _______ book sold to ravi     _______     _________
    books Purchasing     sold     social _______ book this is a good book sold to kiran aug10th     ronald
    books Purchasing sold     maths book to sal     _____     __________
    books Purchasing     sold     english book__________ this was a newbook to raj __________     jak
    books Purchasing return     maths book return by:_____________ Verify book aug11th     john
    books Purchasing     return     story book by:_________ checked aug14th     _________
    Thanks in advance.

    Isn't school work marvelous?
    Create an external table.
    http://www.morganslibrary.org/reference/externaltab.html
    Getting the data into a temporary table may make sense in SQL Server ... but not in Oracle.

  • Can you log into CC on two computers on the same IP address at the same time?

    Can you log into CC on two computers on the same IP address at the same time? Because i accidentally opened both and was wondering if it will affect my membership or deny me access to CC. Thanks

    Cloud License allows 2 activations http://www.adobe.com/legal/licenses-terms.html
    -Install on a 2nd computer http://forums.adobe.com/thread/1452292?tstart=0
    -Windows or Mac does not matter... 2 on the same operating system, or 1 on each
    -Both subscriptions MAY be in use at the same time https://forums.adobe.com/thread/1683787

  • How many photos can you load into Organizer and Editor

    How many photos can you load into Organizer and Editor at one time.  I receive the error message, "Unable to Import Files", which says "You exceeded number of files that can be selecteed and imported at once...."  What is the number?  Secondly is there a way around this for either the Organizer or Editor to work on thousands of photos at the same time?
    Thanks

    I have never heard of this particular limit before.
    Please understand, this appears to be the limit you can import into the Organizer at one time -- you can have as many photos as you want in the Organizer; but apparently you have to import in batches rather than all at once.
    I don't think it applies to the editor; and I can't imagine wanting to have more then a few files in the editor at any one time ... even if you could open 2000 photos in the editor at once, what sense would that make?

  • HT5035 Can you select whether to use a gift card or your credit card when purchasing

    I have iTunes gift cards but don't always want to redeem them. Sometimes I want to use my credit card.  Do you have to automatically redeem the gift cards or can you select credit even if your gift card has a balance?

    You can't choose which to use to pay for your order. The default order of payment is free credits first, if you have some, then store credits then credit card. I'm not sure how to explain this but this is what I know. You can contact support if you want for more info.
    http://www.apple.com/support/itunes/

  • How can I select columns from a table EMP, using Select statement?.

    Hi Friends,
    How can I select columns from a table EMP?.
    I want to select columns of EMP table, using select statement.
    Please reply me urgently.
    Shahzad

    Something like this:
    scott@DBA> select empno,ename,job from emp;
         EMPNO ENAME      JOB
          7369 SMITH      CLERK
          7499 ALLEN      SALESMAN
          7521 WARD       SALESMAN
          7566 JONES      MANAGER
          7654 MARTIN     SALESMAN
          7698 BLAKE      MANAGER
          7782 CLARK      MANAGER
          7788 SCOTT      ANALYST
          7839 KING       PRESIDENT
          7844 TURNER     SALESMAN
          7876 ADAMS      CLERK
          7900 JAMES      CLERK
          7902 FORD       ANALYST
          7934 MILLER     CLERK
    14 rows selected.Check the documentation:
    http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_10002.htm#sthref9697
    Message was edited by:
    Delfino Nunez

  • Select * into Table1 from Table not working

    Hi,
    How to copy data from one table to other new table using select * into statement.
    I am getting missing keyword error when I use the statement
    select * into Table1 from Table
    Thanks a lot in advance.
    Regards,
    Praveen

    the syntax is
    INSERT INTO table1 SELECT * FROM table2;

  • Select into from 2 tables

    Thanks in advance
    Is it possible do a SELECT INTO from 2 tables, that is (like in Informix)
    declare
    rg_table1    table1%ROWTYPE;
    rg_table2    table2%ROWTYPE;
    BEGIN
                 SELECT A.*, B.* INTO  rg_table1 , rg_table2                           
                       FROM table1 a, table2 B
                            WHERE ....

    no, I don't think so....
    SQL> declare
      2     t1 t%rowtype;
      3     s1 s%rowtype;
      4  begin
      5     select t.*
      6          , s.*
      7       into t1
      8          , s1
      9    from t, s
    10    where rownum = 1;
    11  end;
    12  /
       select t.*
    ERROR at line 5:
    ORA-06550: line 5, column 4:
    PLS-00494: coercion into multiple record targets not supported
    ORA-06550: line 9, column 3:
    PL/SQL: ORA-00904: : invalid identifier
    ORA-06550: line 5, column 4:
    PL/SQL: SQL Statement ignored

  • HT4528 how can you select 1 photo from a shared photo stream and save it to your HD

    Can you select a single photo from a shared photo stream that some had sent me as I want to save and print the family photo?

    FAQ photo stream http://support.apple.com/kb/HT4486

  • Insert slow into Global Temporary Table...

    I am working with a stored procedure that does a select into a global temporary table and it is really slow. I have read up on the append hint and know that it is not a solution since GTT's are in the temporary table space which are thus always appended and never have logs.
    Is there something else that I need to know about performance for GTT? I find it hard to believe that Oracle would find it acceptable to take 50 seconds to insert 3300 rows.

    My apologies in advance as my skill level with Oracle is not as high as I would like for this type of analysis and remediation.
    I had thought of it being the select as well but if I run it by itself it takes about 1 second. The interesting part is when I explain plan on it with the Insert, the SQL plan changes.
    Here is the Non-insert explain plan:
    <code class="jive-code jive-java">
    Plan hash value: 3474166068
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 51 | 8 (38)| 00:00:01 |
    | 1 | HASH GROUP BY | | 1 | 51 | 8 (38)| 00:00:01 |
    | 2 | VIEW | VM_NWVW_1 | 1 | 51 | 7 (29)| 00:00:01 |
    | 3 | HASH UNIQUE | | 1 | 115 | 7 (29)| 00:00:01 |
    | 4 | NESTED LOOPS | | | | | |
    | 5 | NESTED LOOPS | | 1 | 115 | 6 (17)| 00:00:01 |
    | 6 | NESTED LOOPS | | 1 | 82 | 5 (20)| 00:00:01 |
    | 7 | SORT UNIQUE | | 1 | 23 | 2 (0)| 00:00:01 |
    | 8 | TABLE ACCESS BY INDEX ROWID| PEAKSPEAKDAYSEG$METERMASTER | 1 | 23 | 2 (0)| 00:00:01 |
    |* 9 | INDEX RANGE SCAN | IDX_PDSEG$MTR_SEGID | 1 | | 1 (0)| 00:00:01 |
    |* 10 | TABLE ACCESS BY INDEX ROWID | FC_FFMTR_DAILY | 1 | 59 | 2 (0)| 00:00:01 |
    |* 11 | INDEX RANGE SCAN | FC_FFMTRDLY_IDX10 | 2461 | | 2 (0)| 00:00:01 |
    |* 12 | INDEX UNIQUE SCAN | FC_METER_PK | 1 | | 0 (0)| 00:00:01 |
    | 13 | TABLE ACCESS BY INDEX ROWID | FC_METER | 1 | 33 | 1 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    9 - access("SM"."SEGID"=584)
    10 - filter(TO_DATE(TO_CHAR("V"."MEASUREMENT_DAY"),'YYYYMMDD')>=TO_DATE(' 2002-01-01 00:00:00',
    'syyyy-mm-dd hh24:mi:ss') AND TO_DATE(TO_CHAR("V"."MEASUREMENT_DAY"),'YYYYMMDD')<TO_DATE(' 2003-01-01
    00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND ("V"."ADJUSTED_TOTAL_VOLUME"<>0.0 OR
    ROUND("V"."ADJUSTED_TOTAL_ENERGY",3)<>0.0))
    11 - access("V"."METER_NUMBER"="SM"."METER_ID")
    12 - access("M"."METER_NUMBER"="V"."METER_NUMBER")
    </code>
    Here is the Insert explain plan:
    <code class="jive-code jive-java">
    Plan hash value: 4282493455
    | Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time |
    | 0 | INSERT STATEMENT | | 39 | 2886 | | 7810 (1)| 00:01:34 |
    | 1 | LOAD TABLE CONVENTIONAL | PEAKDAY_TEMP_CONSECUTIVEVALUES | | | | | |
    | 2 | HASH GROUP BY | | 39 | 2886 | | 7810 (1)| 00:01:34 |
    |* 3 | HASH JOIN RIGHT SEMI | | 39 | 2886 | | 7809 (1)| 00:01:34 |
    | 4 | VIEW | VW_NSO_1 | 1 | 10 | | 2 (0)| 00:00:01 |
    | 5 | NESTED LOOPS | | 1 | 27 | | 2 (0)| 00:00:01 |
    |* 6 | INDEX UNIQUE SCAN | PK_PEAKSPEAKDAYSEG | 1 | 4 | | 0 (0)| 00:00:01 |
    | 7 | TABLE ACCESS BY INDEX ROWID | PEAKSPEAKDAYSEG$METERMASTER | 1 | 23 | | 2 (0)| 00:00:01 |
    |* 8 | INDEX RANGE SCAN | IDX_PDSEG$MTR_SEGID | 1 | | | 1 (0)| 00:00:01 |
    | 9 | VIEW | PEAKS_RP_PEAKDAYMETER | 3894 | 243K| | 7807 (1)| 00:01:34 |
    | 10 | SORT UNIQUE | | 3894 | 349K| 448K| 7807 (1)| 00:01:34 |
    | 11 | NESTED LOOPS | | | | | | |
    | 12 | NESTED LOOPS | | 3894 | 349K| | 7722 (1)| 00:01:33 |
    | 13 | TABLE ACCESS FULL | FC_METER | 637 | 21021 | | 18 (0)| 00:00:01 |
    |* 14 | INDEX RANGE SCAN | FC_FFMTRDLY_IDX11 | 6 | | | 10 (0)| 00:00:01 |
    |* 15 | TABLE ACCESS BY INDEX ROWID| FC_FFMTR_DAILY | 6 | 354 | | 12 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    3 - access("METER_ID"="METER_ID")
    6 - access("GS"."SEGID"=584)
    8 - access("SM"."SEGID"=584)
    14 - access("M"."METER_NUMBER"="V"."METER_NUMBER")
    filter(TO_DATE(TO_CHAR("V"."MEASUREMENT_DAY"),'YYYYMMDD')>=TO_DATE(' 2002-01-01 00:00:00', 'syyyy-mm-dd
    hh24:mi:ss') AND TO_DATE(TO_CHAR("V"."MEASUREMENT_DAY"),'YYYYMMDD')<TO_DATE(' 2003-01-01 00:00:00', 'syyyy-mm-dd
    hh24:mi:ss'))
    15 - filter("V"."ADJUSTED_TOTAL_VOLUME"<>0.0 OR ROUND("V"."ADJUSTED_TOTAL_ENERGY",3)<>0.0)
    </code>
    As you can see there is a real spike in the cost and yet the only thing that was done was the addition of the Insert to GTT. From what I can ascertain the solution may be in an alternate SQL or finding some way to push Oracle into running the query as it would have for the first execution (non-insert).
    I tried creating a simple view out of the SELECT statement to see if that would precompile it but in the end it ran exactly the same way.
    The next thing that I am going to try is removing the PEAKS_RP_PEAKDAYMETER view by going more direct.
    I have not done the trace file analysis yet. Should I still do that?

  • How can you SELECT via Database Link CLOB data using Application Express?

    Customer Issue:
    Developer using Oracle's Application Express 3.1. The Developer is trying to SELECT a CLOB datatype column from a remote (10.2.0.3) database, via a database link on her 10.2.0.4 based client Application. The Developer wants to be able to select CLOB data from the remote database which has limitation that she can't make any changes to the remote database.
    Developer's Comments:
    I do a select and get the error. Getting error ORA-22992: cannot use LOB locators selected from remote tables. So she feels she can't use dbms_lob.substr in this configuration I can do a "select into" but that is for one value. I am trying to run a select statement for a report that brings back more than one row. I do not have permission to change anything on the remote database. I want to access the remote database and multiple tables.
    This is not something I work with, would greatly appreciate help or ideas. Is this a limitation of the 3.1; or does she just not have this set up correctly; or should she be using a Collection (if yes, please share example)
    Thanks very much,
    Pam
    Edited by: pmoutrie on Jun 4, 2009 12:01 PM
    Hello???
    Would really appreciate an answer.
    Thanks,
    Pam

    This may not be a perfect solution for you but it worked for my situation.
    I wanted to grab some data from Grid Control's MGMT$JOB_STEP_HISTORY table but I couldnt' create an Interactive Report due to the existance of a CLOB column. I cheated this by creating a view on the GC DB, grabbing the first 4000 characters and turning it into a varchar2 column:
    create view test_job_step_history as
    select job_Name, target_name, status, start_time, end_time, to_char(substr(output,1,4000)) output
    from MGMT$JOB_STEP_HISTORY where trunc(end_time) > trunc(sysdate)-90
    In an APEX Interactive Report:
    select * from test_job_step_history@GCDB
    Granted, the output looks aweful right now but I am only looking for a very particular output (failed, denied, ORA-, RMAN-, etc) so the formatting isn't the most important thing to me right now.
    If anyone can improve -- and I'm sure you can -- on this I'd love to hear about it.
    Thanks,
    Rich

  • Help: Error on SELECT INTO TABLE2 FROM TABLE AS E1 JOIN...

    Can anyone help? I am getting an error in my sql statement below:
    SELECT E1.COL1, E1.COL2, E2.COL3, E1.COL4
    INTO TABLE2
    FROM TABLE AS E1
    JOIN TABLE AS E2 ON
    (E1.COL1 = '10000' AND E2.COL1 = '20000') OR
    (E1.COL1 = '20000' AND E2.COL1 = '10000')
    WHERE
    E1.COL3 = E2.COL3 AND E1.COL4 = '11000' AND E1.COL3 < '2011/04/01'
    The script works fine on SQL Server (2008) but I am unable to run it in Oracle.
    I am using Oracle SQL Developer v1.5.4 Build MAIN-5940.
    Thanks in advance for anyone who can help.

    Tubby wrote:
    850777 wrote:
    Thanks for the immediate reply Tubby. I will try removing the AS for aliasing.
    I still have one more problem though (about removing the line INTO TABLE2) because
    I am actually using it to store the SELECTed data into the new TABLE2. Is there a workaround for this? ThanksWhat are you trying to do here? View the data produced by the query, or create a pl/sql routine?
    What's the point behind creating a table to store the results in?
    Tubby wrote:850777 wrote:
    Thanks for the immediate reply Tubby. I will try removing the AS for aliasing.
    I still have one more problem though (about removing the line INTO TABLE2) because
    I am actually using it to store the SELECTed data into the new TABLE2. Is there a workaround for this? ThanksWhat are you trying to do here? View the data produced by the query, or create a pl/sql routine?
    What's the point behind creating a table to store the results in?What I am trying to do is copy the data in TABLE to TABLE2 but with the data in E1.COL3 swapped with the one in E2.COL3 based on certain conditions.
    Basically I am just trying to swap the values of a column (COL3) and store it in my new table (TABLE2) together with all the (unswapped) values from all the other columns.
    Ex.
    TABLE
    COL1 COL2 COL3 COL4
    1 1 1 1
    2 2 3 2
    3 3 2 2
    4 4 4 1
    Target result:
    TABLE2
    COL1 COL2 COL3 COL4
    1 1 1 1
    2 2 2 2 <-swapped values
    3 3 3 2 <-in COL3
    4 4 4 1

  • Sql/Plsql code to store data into a temporary table from a text file

    Dear all,
    I need to create a temporary table getting data from a text file. I am very new to data loading could you please help me how to read the text file in to a temporary table.
    i have text file like as below:
    order* items : books Purchasing
    start date:
    8-11-09
    Notes: Books are selling from aug10 to aug 25
    Action performed*
    Time*
    Verified By*
    sold* out from shop, sold out date:_________
    +1.+
    physics _______ book sold to ravi
    +2.+
    social _______ book this is a good book
    sold to kiran
    aug10th
    ronald
    +3.+
    maths book to sal
    +4.+
    english book__________ this was a newbook
    to raj
    jak
    return* to shop, return date:____________
    +1.+
    maths book return by:_____________ Verify book
    aug11th
    john
    +2.+
    story book by:_________ checked
    aug14th
    Now i need to create a temporary table with 5columns(order,Status,Action_Performed,Time,Verified_By) like as below:
    Now i need to create a temporary table named as books_order with 5columns(order,Status,Action_Performed,Time,Verified_By) like as below:
    Order               status     Action_Performed                         Time               Verified_By
    books Purchasing     sold          physics _______ book sold to ravi               _______          _________
    books Purchasing     sold          social _______ book this is a good book sold to kiran aug10th               ronald
    books Purchasing sold          maths book to sal                         _____               __________
    books Purchasing     sold          english book__________ this was a newbook to raj __________          jak
    books Purchasing return     maths book return by:_____________ Verify book      aug11th               john
    books Purchasing     return     story book by:_________ checked                aug14th               _________
    Thanks in advance.

    Hi,
    Thanks for your suggestions. I Was able to get the data using utl_file.get_line. But i was not able to the data if it is in the below format:
    I was able to read the data and storing if it is in the same line.But i dont know how to read below data
    Book. Type Name Location Ownership Code
    Story SL hyd SS-HYD
    In this data i have to search for 'Book. type' and then i need to save the word 'Story' to the column 'Book_type'
    Then i need to search for 'Name' and i need to save 'SL' into the column into 'Name'
    Then i need to search for 'Location' and i need to save 'hyd' into the column into 'Location'
    I was able to extract the data if it is in below format using utl_file.get_line
    Known Author: Unknown
    Less Selling Factors: Thunderstorms
    Reason: Unknown
    Any one can explain me how to solve the above criteria.
    Below i am explaining the same problem in detail.
    I have a text file as below and i have a table having 12 columns. Now i need to insert this text file into the table story_books.
    CREATE TABLE story_books
    book_id NUMBER,
    Category VARCHAR2(100 BYTE),
    Book_type VARCHAR2(100 BYTE),
    Name VARCHAR2(700 BYTE),
    Location VARCHAR2(700 BYTE),
    Ownership_code VARCHAR2(700 BYTE),
    Author VARCHAR2(700 BYTE),
    Less_Sel_fact VARCHAR2(700 BYTE),
    Reason VARCHAR2(700 BYTE),
    Buying VARCHAR2(700 BYTE),
    Suspected Book VARCHAR2(700 BYTE),
    Conditions VARCHAR2(700 BYTE)
    -------------------------text file---------------
    Books Out Table: Books
    Book. Type Name Location Ownership Code
    Story SL hyd SS-HYD
    Known Author: Unknown
    Less Selling Factors: Thunderstorms
    Reason: Unknown
    Buying (if applicable):
    Not Applicable
    Suspected Book:
    Unknown
    Conditions to increace sales:
    Advertisement in all areas
    i was able to read the data and storing if it is in the same line.But i dont know how to read below data
    Book. Type Name Location Ownership Code
    Story SL hyd SS-HYD
    In this data i have to search for 'Book. type' and then i need to save the word 'Story' to the column 'Book_type'
    Then i need to search for 'Name' and i need to save 'SL' into the column into 'Name'
    Then i need to search for 'Location' and i need to save 'hyd' into the column into 'Location'
    I was able to extract the data if it is in below format using utl_file.get_line
    Known Author: Unknown
    Less Selling Factors: Thunderstorms
    Reason: Unknown
    Any one can explain me how to solve the above criteria.
    Thanks in advance.

Maybe you are looking for

  • 2011 Macbook Pro 17" Thunderbolt port "No Device Connected"

    Please help! I have a 2011 (early) 17" Macbook Pro (8,3) Core i7 - 2.2 Boot Rom: MBP81.0047.B27 SMC: 1.70f6 Running Yosemite 10.10 I recently purchased a Akitio Thunderdock. ***It does not mount and when I check the system report, the thunderbolt bus

  • Memory for my 2x3 Ghz Dual-Core Intel Xeon

    Earlier this year I bought a refurbished Quad 3 Ghz Mac Pro Model number FA765LL/A. It came with 2 GB of RAM installed as (4x 512MB) I'm of the school of thought that it's best to buy the largest size chips to be in a better position to max out the r

  • Airplay STOPS after printing on G Express

    I just installed a Samsung ML-2010 to a G based Airport Express in WDS bridge mode. For some reason, the native ML-2010 print drivers do not work, but the ML-1630 driver does work. If I am playing audio through the Airport Express and decide to print

  • Restricting the Query Design Mode Toolbar in BEx

    Hello, Query Design Mode toolbar is available to Citrix users when using the BEx Analyser. THe client would like this switched off in the workbooks so users cannot see the make-up of the query.  Does anyone one know who to carry this out? Thanks, Hem

  • Copying Mails from one Mac to another Mac

    Hi There, I want to copy all my emails (pop account) from the harddisk of mini Mac OS X 10.4.6 to my PowerBook OS X 10.4.6. How to do? I tried it through .Mac but that doesn't work (when synchronising the source with .Mac the emails don't appear in M