TEMP Tables: I hv yet to receive replies for prev mails

Can we create temp tables from a PL/SQL block in 8i.
If not how do we create it, using Dynamic PL/SQL. Any help will
be appreciated.
Thanks
Anish
null

ANISH (guest) wrote:
: Can we create temp tables from a PL/SQL block in 8i.
: If not how do we create it, using Dynamic PL/SQL. Any help
will
: be appreciated.
: Thanks
: Anish
Anish,
Dynamic SQL will work. Though you have not mention how the temp
table is going to be used, another option could be PL/SQL table;
which is an array in PASCAL, C, Ada and other languages.
If you are going to use the temp table to hold intermediary
results, I will recommend considering PL/SQL table. Otherwise,
dynamic SQL will the only option.
If you are opting for dynamic SQL, you may want to pass in
parameters such as tablespace name, table name, storage
parameters, etc. Then, this procedure can be used to create more
than one table.
Regards,
John
null

Similar Messages

  • I would like to use removable hard disk drive (portable hard disk) for iphone because of many data, report and so on. I want to receive data for e-mail, so the iphone holds large amounts of data for a long time, and i want to use its at any time

    nowadays, people use removable hard disk drive (portable hard disk) & usb flash drive at computer because of usability, easy to carry around.
    so, i would like to use these functions for iphone. i want to develop mini portable hard disk for the use of iphone like computer

    Not a feature of iphone.

  • Issue with Temp tables in SSIS 2012 with RetainSameConnection=true

    Hello,
    We have few packages written in 2008 and are being upgraded to 2012. Our package mostly uses temp tables during the process.  During initial migration, we faced issue with handling temp table in the OLE Db destination provider and found a solution for
    the same under 
    usage of Temp tables in SSIS 2012
    Most of our packages execute fine now. 
    we came across a different issue recently. For one of our package, which merges 3 feeds into a temp table and then executes a stored procedure for processing, the package fails intermittently.
    Below are properties of SSIS and its components, which you might be interested
    * Retainsameconnection for the OLE Db connection manager set to True
    * properties of OLEDB Destination 
    AccessMode : SQL Command
    CommandTimeOut : 0
    SQLCommand : Select * from #tmp
    * using SSIS 2012 and SQL OLEDB Native Provider 11 (Provider=SQLNCLI11.1)
    * one of the feed is 10MB
    During investigation using profiler, found that though I use RetainSameConnection, I often  could see that more than one SPId is used during the scope of SSIS execution and when ever this happens, package fails with below error message 
    An OLE DB record is available. Source: "Microsoft SQL Server Native Client 11.0" Hresult: 0x80040E14 Description: "Statement(s) could not be prepared.".
    An OLE DB record is available. Source: "Microsoft SQL Server Native Client 11.0" Hresult: 0x80040E14 Description: "Invalid object name '#tmp'."
    Now, Why SSIS uses a different SPId during its execution when RetainSameconnection is set to True (note : I have only one OLEDB connection in that package)? 
    To simulate the issue, Instead of 10MB file, I used a 500KB file and execute the package twice and all went fine.
    Is it because of 10 MB file taking long time to process causing the time out of that OLEDB destionation forcing the SSIS to go for another connection? but remember, CommandTimeout is set to infinite(0) for that OLEDB destination. 
    Much appreciated your response. 

    Hey,
    I understand you used Retainsameconnection property true for all the OLEDB connections you used in the package if not make sure its for all the connection including file connection as well.
    Additionally, you can try to set Delayvalidation property to true for all the dataflows and control flows in the connection and try running the package for 10MB file.
    I hope this will fix the intermittent failure issue you are facing with SSIS.
    (Please mark solved if I've answered your question, vote for it as helpful to help other user's find a solution quicker)
    Thanks,
    Atul Gaikwad.

  • SQL tune for temp table

    I am executing a query for which there is a system temp table is used, How could i tune for better execution?
    Please see the execution plan below
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 25 | 2650 | 83 (2)| 00:00:01 |
    |* 1 | COUNT STOPKEY | | | | | |
    | 2 | NESTED LOOPS | | | | | |
    | 3 | NESTED LOOPS | | 25 | 2650 | 83 (2)| 00:00:01 |
    | 4 | NESTED LOOPS | | 25 | 1900 | 81 (2)| 00:00:01 |
    | 5 | VIEW | | 603 | 28341 | 78 (2)| 00:00:01 |
    | 6 | TEMP TABLE TRANSFORMATION | | | | | |
    | 7 | LOAD AS SELECT | PRODUCTS | | | | |
    | 8 | HASH UNIQUE | | 114 | 2736 | 1435 (2)| 00:00:18 |
    |* 9 | HASH JOIN | | 114 | 2736 | 1434 (2)| 00:00:18 |
    |* 10 | TABLE ACCESS FULL | CUSTOMERS | 65 | 780 | 865 (2)| 00:00:11 |
    | 11 | TABLE ACCESS BY INDEX ROWID | ORDER_LINES | 252K| 2956K| 567 (1)| 00:00:07 |
    |* 12 | INDEX RANGE SCAN | OL_O1 | 252K| | 85 (0)| 00:00:02 |
    | 13 | SORT ORDER BY | | 603 | 81405 | 439 (3)| 00:00:06 |
    | 14 | HASH GROUP BY | | 603 | 81405 | 439 (3)| 00:00:06 |
    |* 15 | HASH JOIN RIGHT ANTI | | 603 | 81405 | 437 (2)| 00:00:06 |
    | 16 | VIEW | | 114 | 912 | 2 (0)| 00:00:01 |
    | 17 | TABLE ACCESS FULL | SYS_TEMP_0FD9D6B20_523F10 | 114 | 912 | 2 (0)| 00:00:01 |
    |* 18 | HASH JOIN | | 604 | 76708 | 435 (2)| 00:00:06 |
    | 19 | TABLE ACCESS BY INDEX ROWID | PRODUCTS | 411 | 8220 | 6 (0)| 00:00:01 |
    |* 20 | INDEX RANGE SCAN | PR_U2 | 411 | | 1 (0)| 00:00:01 |
    |* 21 | HASH JOIN | | 2177 | 227K| 428 (2)| 00:00:06 |
    | 22 | NESTED LOOPS | | | | | |
    | 23 | NESTED LOOPS | | 7348 | 423K| 325 (2)| 00:00:04 |
    |* 24 | HASH JOIN | | 114 | 3078 | 176 (3)| 00:00:03 |
    | 25 | VIEW | | 114 | 912 | 2 (0)| 00:00:01 |
    | 26 | TABLE ACCESS FULL | SYS_TEMP_0FD9D6B20_523F10 | 114 | 912 | 2 (0)| 00:00:01 |
    |* 27 | TABLE ACCESS FULL | CUSTOMER_CLUSTERS | 86315 | 1601K| 173 (2)| 00:00:03 |
    |* 28 | INDEX RANGE SCAN | IDX_RULES_COMM_ANTE_PROB | 64 | | 1 (0)| 00:00:01 |
    | 29 | TABLE ACCESS BY INDEX ROWID| RULES | 64 | 2048 | 1 (0)| 00:00:01 |
    |* 30 | TABLE ACCESS FULL | CLUSTER_PRODUCTS | 18418 | 863K| 103 (1)| 00:00:02 |
    | 31 | TABLE ACCESS BY INDEX ROWID | CUSTOMERS | 1 | 29 | 1 (0)| 00:00:01 |
    |* 32 | INDEX UNIQUE SCAN | CU_PK | 1 | | 1 (0)| 00:00:01 |
    |* 33 | INDEX UNIQUE SCAN | PR_PK | 1 | | 1 (0)| 00:00:01 |
    | 34 | TABLE ACCESS BY INDEX ROWID | PRODUCTS | 1 | 30 | 1 (0)| 00:00:01 |
    ---------------------------------------------------------------------------------------------------------------------

    ID 17 and 26
    17 | TABLE ACCESS FULL | SYS_TEMP_0FD9D6B20_523F10 | 114 | 912 | 2 (0)| 00:00:01 |

  • How to read the data file and write into the same file without a temp table

    Hi,
    I have a requirement as below:
    We are running lockbox process for several business, but for a few businesses we have requirement where in we receive a flat file in different format other than how the transmission format is defined.
    This is a 10.7 to 11.10 migration. In 10.7 the users are using a custom table into which they are first loading the raw data and writing a pl/sql validation on that and loading it into a new flat file and then running the lockbox process.
    But in 11.10 we want to restrict using temp table how can we achieve this.
    Can we read the file first and then do validations accordingly and then write to the same file and process the lockbox.
    Any inputs are highly appreciated.
    Thanks & Regards,
    Lakshmi Kalyan Vara Prasad.

    Hello Gurus,
    Let me tell you about my requirement clearly with an example.
    Problem:
    i am receiving a dat file from bank in below format
    105A371273020563007 07030415509174REF3178503 001367423860020015E129045
    in this detail 1 record starting from 38th character to next 15 characters is merchant reference number
    REF3178503 --- REF denotes it as Sales Order
    ACC denotes it as Customer No
    INV denotes it as Transaction Number
    based on this 15 characters......my validation comes.
    If i see REF i need to pick that complete record and then fill that record with the SO details as per my system and then submit the file for lockbox processing.
    In 10.7 they created a temporary table into which they are loading the data using a control file....once the data is loaded into the temporary table then they are doing a validation and updating the record exactly as required and then creating one another file and then submitting the file for lockbox processing.
    Where as in 11.10 they want to bypass these temporary tables and writing it into a different file.
    Can this be handled by writing a pl/sql procedure ??
    My findings:
    May be i am wrong.......but i think .......if we first get the data into ar_payments_interface_all table and then do the validations and then complete the lockbox process may help.
    Any suggestions from Oracle GURUS is highly appreciated.
    Thanks & Regards,
    Lakshmi Kalyan Vara Prasad.

  • Global Temp table with BLOB causing session crash

    Hi,
    i have a table as follows:
    create global temporary table spg_file_import (
    name varchar2 (128) constraint sfi_nam_ck not null,
    mime_type varchar2 (128),
    doc_size number,
    dad_charset varchar2 (128),
    last_updated date,
    content_type varchar2 (128),
    content long raw,
    blob_content blob
    on commit delete rows
    this is my 9ias 'document' table thats used to receive uploaded files which i modified to be global temporary.
    what i want to do is:
    a)upload a text file (xml)
    b) convert that file to clob
    c) store that file in new permanent table as clob
    d) commit (hence delete temp table rows as they are no longer necessary)
    to test it i have:
    CREATE OR REPLACE procedure daz_html
    as
    begin
    htp.p(' <FORM enctype="multipart/form-data" action="daz_fu" method="POST">');
    htp.p(' <p>');
    htp.p(' File to upload: <INPUT type="file" name="p_file_in"><br>');
    htp.p(' <p><INPUT type="submit">');
    htp.p(' </form>');
    htp.p('</body>');
    htp.p('</html>');
    end;
    CREATE OR REPLACE procedure daz_fu (
    p_file_in varchar2
    as
    -- BLOB Stream locator
    v_raw blob;
    v_clob clob;
    v_blob_length number;
    v_length number;
    v_buffer varchar2(32767);
    v_pos number := 1;
    begin
    -- Get xml document from transient 9iAs data store.
    select blob_content
    into v_raw
    from spg_file_import
    where name = p_file_in;
    -- create temp LOB
    dbms_lob.createtemporary(v_clob, false);
    -- get BLOB length
    v_blob_length := dbms_lob.getlength(v_raw);
    loop
    -- get length to read. this is set as a max length of 32767
    v_length := least((v_blob_length - (v_pos-1)),32767);
    -- assign BLOB to a varchar2 buffer in preparation to convert to CLOB
    v_buffer := utl_raw.cast_to_varchar2(dbms_lob.substr(v_raw, v_length, v_pos));
    -- now write out to the CLOB
    dbms_lob.writeappend(v_clob, v_length, v_buffer);
    -- increment our position.
    v_pos := v_pos + v_length;
    -- exit when we are done.
    exit when v_pos >= v_blob_length;
    end loop;
    commit;
    htp.p('commit done!');
    end;
    now if i upload a small text file (about 5kb) it works with no problem.
    however if I upload a large text file (say about 1Mb) it crashes oracle with:
    Fri, 26 Jul 2002 11:49:24 GMT
    ORA-03113: end-of-file on communication channel
    DAD name: spgd1
    PROCEDURE : daz_fu
    USER : spg
    URL : http://www.bracknell.bt.co.uk/pls/spgd1/daz_fu
    PARAMETERS :
    ============
    p_file_in:
    F22210/Document.txt
    this produces a large trc file.. the trace file indicates the crash occured on the commit; line
    Current RBA:[0x4eb0.117.10]
    *** 2002-07-26 12:35:11.857
    ksedmp: internal or fatal error
    ORA-00600: internal error code, arguments: [kcblibr_user_found], [4294967295], [2], [12583564], [65], [], [], []
    Current SQL statement for this session:
    declare
    rc__ number;
    begin
    owa.init_cgi_env(:n__,:nm__,:v__);
    htp.HTBUF_LEN := 255;
    null;
    daz_fu(p_ref_in=>:p_ref_in,p_type_in=>:p_type_in,p_file_in=>:p_file_in);
    if (wpg_docload.is_file_download) then
    rc__ := 1;
    wpg_docload.get_download_file(:doc_info);
    null;
    commit;
    else
    rc__ := 0; null;
    commit;
    owa.get_page(:data__,:ndata__);
    end if;
    :rc__ := rc__;
    end;
    ----- PL/SQL Call Stack -----
    object line object
    handle number name
    812b1998 42 procedure SPG.DAZ_FU
    819dff90 7 anonymous block
    ----- Call Stack Trace -----
    If i reaplce the temporary table with a non-temp table of the same structure i get no problems what-so-ever. Am I doing something that I shouldnt be with global temporary tables?
    Thanks.

    This is on Oracle 8.1.7.2

  • Use global temp table for DML error logging

    our database is 11.2.0.4 enterprise edition on solaris 10
    we are wondering if anyone has an opinion of or has done this before, to use a global temp table for DML error logging. We have a fairly busy transactional database with 2 hot tables for inserts. The regular error table created with dbms_errlog has caused many deadlocks which we don't quite understand yet. we have thought using global temp table for the purpose, and that seemed to work, but we can't read error from the GTT, the table is empty even reading from the same session as inserts. Does anyone have an idea why?
    Thanks

    The insert into the error logging table is done with a recursive transaction therefore it's private from your session which is doing the actual insert.
    Adapted from http://oracle-base.com/articles/10g/dml-error-logging-10gr2.php
    INSERT INTO dest
    SELECT *
    FROM  source
    LOG ERRORS INTO err$_dest ('INSERT') REJECT LIMIT UNLIMITED;
    99,998 rows inserted.
    select count(*) from dest;
      COUNT(*)
        99998
    SELECT *
    FROM  err$_dest
    WHERE  ora_err_tag$ = 'INSERT';
    1400    "ORA-01400: cannot insert NULL into ("E668983_DBA"."DEST"."CODE")"        I    INSERT    1000        Description for 1000
    1400    "ORA-01400: cannot insert NULL into ("E668983_DBA"."DEST"."CODE")"        I    INSERT    10000        Description for 10000
    1400    "ORA-01400: cannot insert NULL into ("E668983_DBA"."DEST"."CODE")"        I    INSERT    1000        Description for 1000
    1400    "ORA-01400: cannot insert NULL into ("E668983_DBA"."DEST"."CODE")"        I    INSERT    10000        Description for 10000
    rollback;
    select count(*) from dest;
      COUNT(*)
            0
    SELECT *
    FROM  err$_dest
    WHERE  ora_err_tag$ = 'INSERT';
    1400    "ORA-01400: cannot insert NULL into ("E668983_DBA"."DEST"."CODE")"        I    INSERT    1000        Description for 1000
    1400    "ORA-01400: cannot insert NULL into ("E668983_DBA"."DEST"."CODE")"        I    INSERT    10000        Description for 10000
    1400    "ORA-01400: cannot insert NULL into ("E668983_DBA"."DEST"."CODE")"        I    INSERT    1000        Description for 1000
    1400    "ORA-01400: cannot insert NULL into ("E668983_DBA"."DEST"."CODE")"        I    INSERT    10000        Description for 10000

  • 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

  • Bulk copy from a temp table

    My input is from a file. Since I do not have an ETL tool, I am using a stored proc to do the ETL (which also gives me an advantage, I do not have to unload the target table to do the join). So, I dump the file contents into a temp table and use it in proc.
    The query is like
    Insert into <target table1> (Select fields and some transformation from <temp table> where <key> not in target table and <some joins with other tables in database>
    Like this I have four queries for four target tables.
    The inserts from the temp table into the target table is very slow because the target has a lot of index and RI. I cannot drop & create the index since the application requirements does not give me that liberty.
    My only option is to insert in a temp table similar to the target but without any index/RI/PK and then dump it into a file and then use SQL loader to load the file contents into target table. This is relatively faster but is a very cumbersome route to me.
    Is there any other way to do bulk insert from one table to another table like SQL loader without using a file? Is there anyway to bypass the index update operation without dropping the index?
    My source will be almost 500,000 rows and target is having 9 million rows.

    Posts like this one are better avoided.
    Because
    - You don't post a version
    - You don't post the SQL
    - You don't post the EXPLAIN PLAN
    It is your assertion the INSERT is to blame, yet it can equally be the SELECT statement involved.
    Basically your post boils down to
    'It doesn't work. Please help', without any relevant information.
    I'm saying this because INSERT SELECT is the fastest method available. OK, you could try the APPEND hint, but in that case you would have to rebuild all indices. Something you state you can not do.
    BULK INSERTs will be slower, SQL*Loader will be slower too, as it involves SQLnet. INSERT SELECT is a server side operation.
    And the 'solution' to do this by means of a file... Ahem, let's not talk about it. It just doesn't work.
    Sybrand Bakker
    Senior Oracle DBA

  • Multiple users accessing the same data in a global temp table

    I have a global temp table (GTT) defined with 'on commit preserve rows'. This table is accessed via a web page using ASP.NET. The application was designed so that every one that accessed the web page could only see their data in the GTT.
    We have just realized that the GTT doesn't appear to be empty as new web users use the application. I believe it has something to do with how ASP is connecting to the database. I only see one entry in the V$SESSION view even when multiple users are using the web page. I believe this single V$SESSION entry is causing only one GTT to be available at a time. Each user is inserting into / selecting out of the same GTT and their results are wrong.
    I'm the back end Oracle developer at this place and I'm having difficulty translating this issue to the front end ASP team. When this web page is accessed, I need it to start a new session, not reuse an existing session. I want to keep the same connection, but just start a new session... Now I'm losing it.. Like I said, I'm the back end guy and all this web/connection/pooling front end stuff is magic to me.
    The GTT isn't going to work unless we get new sessions. How do we do this?
    Thanks!

    DGS wrote:
    I have a global temp table (GTT) defined with 'on commit preserve rows'. This table is accessed via a web page using ASP.NET. The application was designed so that every one that accessed the web page could only see their data in the GTT.
    We have just realized that the GTT doesn't appear to be empty as new web users use the application. I believe it has something to do with how ASP is connecting to the database. I only see one entry in the V$SESSION view even when multiple users are using the web page. I believe this single V$SESSION entry is causing only one GTT to be available at a time. Each user is inserting into / selecting out of the same GTT and their results are wrong.
    I'm the back end Oracle developer at this place and I'm having difficulty translating this issue to the front end ASP team. When this web page is accessed, I need it to start a new session, not reuse an existing session. I want to keep the same connection, but just start a new session... Now I'm losing it.. Like I said, I'm the back end guy and all this web/connection/pooling front end stuff is magic to me.
    The GTT isn't going to work unless we get new sessions. How do we do this?
    Thanks!You may want to try changing your GTT to 'ON COMMIT DELETE ROWS' and have the .Net app use a transaction object.
    We had a similar problem and I found help in the following thread:
    Re: Global temp table problem w/ODP?
    All the best.

  • Temp Tables - Best Practice

    Hello,
    I have a customer who uses temp tables all over their application.
    This customer is a novice and the app has its roots in VB6. We are converting it to .net
    I would really like to know the best practice for using temp tables.
    I have seen code like this in the app.
    CR2.Database.Tables.Item(1).Location = "tempdb.dbo.[##Scott_xwPaySheetDtlForN]"
    That seems to work, though i do not know why the full tempdb.dbo.[## is required.
    However, when i use this in the new report I am doing I get runtime errors.
    i also tried this
    CR2.Database.Tables.Item(1).Location = "##Scott_xwPaySheetDtlForN"
    I did not get errors, but I was returned data i did not expect.
    Before i delve into different ways to do this, i could use some help with a good pattern to use.
    thanks

    Hi Scott,
    Are you using the RDC still? It's not clear but looks like it.
    We had an API that could piggy back the HDBC handle in the RDC ( craxdrt.dll ) but that API is no longer available in .NET. Also, the RDC is not supported in .NET since .NET uses the framework and RDC is COM.
    Work around is to copy the temp data into a data set and then set location to the data set. There is no way that I know of to get to the tempdb from .NET. Reason being is there is no CR API to set the owner of the table to the user, MS SQL Server locks the tempdb to that user has exclusinve rights on it.
    Thank you
    Don

  • Difference between Temp table and Variable table and which one is better performance wise?

    Hello,
    Anyone could you explain What is difference between Temp Table (#, ##) and Variable table (DECLARE @V TABLE (EMP_ID INT)) ?
    Which one is recommended to use for better performance?
    also Is it possible to create CLUSTER and NONCLUSTER Index on Variable table?
    In my case: 1-2 days transactional data are more than 3-4 Millions. I tried using both # and table variable and found table variable is faster.
    Is that Table variable using Memory or Disk space?
    Thanks Shiven:) If Answer is Helpful, Please Vote

    Check following link to see differences b/w TempTable & TableVariable: http://sqlwithmanoj.com/2010/05/15/temporary-tables-vs-table-variables/
    TempTables & TableVariables both use memory & tempDB in similar manner, check this blog post: http://sqlwithmanoj.com/2010/07/20/table-variables-are-not-stored-in-memory-but-in-tempdb/
    Performance wise if you are dealing with millions of records then TempTable is ideal, as you can create explicit indexes on top of them. But if there are less records then TableVariables are good suited.
    On Tables Variable explicit index are not allowed, if you define a PK column, then a Clustered Index will be created automatically.
    But it also depends upon specific scenarios you are dealing with , can you share it?
    ~manoj | email: http://scr.im/m22g
    http://sqlwithmanoj.wordpress.com
    MCCA 2011 | My FB Page

  • Benefit and limitation of temp table in sql server 2008

    I have a datagrid in front end of asp.net . when user select a row it shows another gridview (multiple row ) where user have to put some data. when user click CLOSE button  i have to keep all data of 2nd gridview in reference with 1st gridview row id. 
    Same process for each row of 1st gridview. If i will keep all the record in a datatable in view state and finally save the data in database table when final save is clicked then the process may be very slow due to large data in view state. So i think to store
    data in temp datable in database for each CLOSE click. For this porpose which temp table i should use
    1. Local temporary tables
    2. Global temporary tables
    3. Normal tables.
    Multiple user may do the same thing same time.  Please help me.
    Thanks

    >1. Local temporary tables
    >2. Global temporary tables
    >3. Normal tables.
    When used in stored procedures, local temporary tables (#table) are automatically multi-user.
    For global temp (##table) & normal tables, you need to develop your own mult-user logic.
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Design & Programming
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • Table or Object type - like #temp table in SQL Server

    Hi
    I need to create a temp table to hold certain data and then validate. What is the best way to do this oracle. Something similar to #temp tables in SQL Server.
    Thanks

    IN Oracle, you create the temporary table once, before you start your program. Then anyone can use that definition, but the system keeps the data isolated to eachr/session.
    The difference in using Oracle: all DDL, including creating temp tables, performs commits and aquires locks that you want to avoid. It creates unnecessary serialization, causes transactional consistency issues and puts Oracle's Read Consistent model at risk (of ORA-01555 errors).
    So, you (or the DBA) would "CREATE GLOBAL TEMPORARY TABLE ..." with the appropriate definition you want, and indicate whether you want the data deleted on commit, or on logoff.
    Then you write your procedure, similar to the way you would do it in SQL Server, but you would not bracket it with creating/dropping the temp table - no need.

  • Inserting data in global temp table?

    Hello experts,
    i have a form having base table master and detail. i can insert upadate the records.
    requirement: creating the global temp table for same form. sothat data save only form session.
    for this i created 2 global temp table having same structure required for same form.
    i changes the property for block as base table to global temp table.
    now i am trying to save the records but not going in the temp table. as i changes the block base table property to temp tables
    as well as advance data block properties also .
    please tell me the reason? where can be the problem.
    thanks yash
    Edited by: yash_08031983 on Apr 16, 2012 1:27 AM

    i am trying to save the records but not going in the temp table.How do you check that? You cannot go to sqlplus and check if there are any records in the GTT. Data in a GTT is only visible in the current session (= only in the form).
    What is the use of a GTT here? What are you trying to achieve?

Maybe you are looking for