HOWTO replace permanent table "Temp"?

Hello

I join a project, but I'm too new to PL/SQL. A special procedure performs a search query. The approach can be summarized as:

* Build a SQL string based on values that are passed in the list parameters
Truncate a table permanently named Temp_SearchID
Run the dynamic SQL string that feeds the table Temp_SearchID (INSERT INTO Temp_SearchID SELECT...)
* Fill in the cursor returned by a SELECT statement to join other tables with the ID in Temp_SearchID

{color: #ff0000} * Q1. * {color} if the application workload is increased, there will be a higher concurrency and suggest that there are several concurrent calls to the above procedure. Since all of these calls has different settings and they want all compete to use the table of Temp_SearchID their own path, what would happen?

* {color: #ff0000} Q2. {color} * if using a permanent table of Temp_SearchID approach is not recommended, it is possible to empty the IDS in a cursor that is local to the procedure. Then do a SELECT associate this slider? In the world of SQL Server, this is possible by using the session Table or the temporary variable local tables. If it is possible to achieve with PL/SQL, can you please show me the syntax or point me to some code snippets?

I thank very you much for any help.

CarbonFiber wrote:

In the scenario, I look after, business rules are a little more complex. Write all of the SQL query in a string would indeed solve the problem. But it would be difficult to debug & test all of the query appear now as a large chain. I could resort to that. As I'm used to SQL Server, I would like to know if Oracle has a memory based structure, and then join it with other tables to produce the final result. I don't know PL/SQL pretty well write a query joining a cursor with a table. Can you show me the syntax of PL/SQL to do?

In a perspective of performance in Oracle the single, plain approach SQL would be probably the best, depending on other factors, like for example how to share the code generated SQL would then (or you will then generate literally thousands of different large SQL statement as part of your process).

As already discussed here you have the possibility of creating a GLOBAL TEMPORARY TABLE that contains the data that is visible only at the session that he uses in Oracle, but it is still read/write the data potentially to disk.

The subquery factoring approach described by David can also be a very good option, if the complexity of education is your main problem.

The memory in Oracle approach is a little more complex. You need to create a type, a collection on top of that type and then use the PL/SQL collection to use in the query, for example like this:

create or replace type t_qualified_id as object (
productid integer
);
/

create or replace type t_qualified_id_array as table of t_qualified_id;
/

create or replace procedure test_collection as
  in_memory_table t_qualified_id_array;
begin
  select t_qualified_id(object_id)
  bulk collect into in_memory_table
  from user_objects;

  for rec in (select object_id
  from table(in_memory_table) a
  inner join user_objects b
  on a.productid = b.object_id) loop
    null;
  end loop;
end;
/

or like this if you do not use the 'object' type, you can simply create an array of built-in number/integer type.

create or replace type t_qualified_id_array as table of integer;
/

create or replace procedure test_collection as
  in_memory_table t_qualified_id_array;
begin
  select object_id
  bulk collect into in_memory_table
  from user_objects;

  for rec in (select object_id
  from table(in_memory_table) a
  inner join user_objects b
  on value(a) = b.object_id) loop
    null;
  end loop;
end;
/

But you can see that there are subtle differences and you must study the SQL and PL/SQL Developer's guide for details. It becomes even more confused because you have in collection types Oracle PL/SQL and SQL collection types that differ in various aspects in terms of use.

Kind regards
Randolf

Oracle related blog stuff:
http://Oracle-Randolf.blogspot.com/

SQLTools ++ for Oracle (Open source Oracle GUI for Windows):
http://www.sqltools-plusplus.org:7676 /.
http://sourceforge.NET/projects/SQLT-pp/

Published by: Randolf Geist Sep 22, 2008 18:57

A subquery factoring mentioned

Tags: Database

Similar Questions

  • Replace/merge/replace/overlay table 3D

    Dear community,

    I was not the way to start this puzzle yet and I can't find an existing solution, so I'm sorry that I don't have any code to fix.

    I've initialized a 3 dimensions array of size 500 x 500 x 200 with zeros that defines my VIEW where I then Index volume on the axis chosen flat to display in an image control.

    My DATA table is also a table in 3 dimensions with the voxel values, but is not necessarily 500 x 500 x 200. I want to do is take some volume is the volume of DATA and replace/replace/overlay on the volume of DISPLAY to the {0,0,0} angle outward, so that the resulting table is full DATA and then completed up to 500 x 500 x 200 with zeros.

    In my view, this should be a core function, but the only function I can find is the subset of the table replace which will replace only in 2D charts. I don't want to have to the index of each item and rebuild, because it would be incredibly slow and heavy memory. Also, I want really manually to "pad" on the DATA of 500 x 500 x 200 table because it feels very awkward and the curls would still be slow.

    In my view, accession of element in Place could hold the key but cannot escape. Any help would be greatly appreciated.

    Sincerely,

    RG

    PS. I am running LV 2015

    Replace the subset of the table has to work, but the type it accepts changes of entry down according to the number of index entry that you wire in there. If you want to replace a table within a table 3D 3D, you will need to wire all the index entries 3 0.

    Note that you may still have performance problems. Your array has elements of 50 M, which could be translated as hundreds of MB of RAM, depending on the type and the number of copies that you create, issue, because the arrays must be contiguous in memory.

    In addition, the image control is not very effective with raster images, so you might have some problems there too.

  • OWB 11 GR 2 - table Temp stage?

    OWB 11 GR 2 - table Temp stage?
    =====================

    I use OWB 11 GR 2 (11.2.0.1) on Win XP 32 bit. We have our repository OWB is on Unix server.

    Find us a Temp table stage with additional clauses of DDL, intermediate table temp and temp stage table in tables propert Inspector.

    How/where we could use this option?

    What is the feature?


    Any idea?

    Thank you for helping.

    Its not used by anything other than the operator dimension today. Thus, you will not get any code generated from it if you configure properties.

    See you soon
    David

  • Replace the Table by...

    Hello

    What is the best Flex normal replacement of TABLE in HTML Tag. We are in a process to test this new technology (Flex) in re-adapting some of our previous web applications and it was a standard for a long time to use TABLE-TR-TD, which does not exist anymore in FLEX, which is the best TAGs to replace those: HBox and VBox? or something else?

    Thank you

    DataGrid is good for displaying the data (my graphic designer will be not so sure on the style that we can apply but still...). But in this case, I was looking for the best method to use as an alternative to the TABLE when we want to display (for example) 3 columns of content. Let's say each column will have several features and it will not help to use the Datagrid control for this kind of needs.

    HBox and VBox, combine with the canvas seems to be the most useful to this end tags.

    Thank you for your reply and the link too!

  • How to replace one table with another?

    I need to replace one table with another. Both tables have the same structure, primary keys, indexes, constraints, but different data (about 50 million records).
    I would like to make this replacement in line, with no passage of database in offline mode.
    There is no clause CREATE or REPLACE TABLE in Oracle unfortunely.
    I could use just DROP and ALTER TABLE RENAME instructions, but it is necessary that a user receive message error "table or view does not exist. It may be possible to block incoming requests at the moment, while old and new droppping table rename are performed?

    Thanks in advance.

    Hi again!

    You can detect normal users with session sessions $ v. A session of a normal user has a username (username of the column). Systemsessions PMON and SMON have no user name. So, you can use the following query to detect sessions, you need to kill:

    SELECT sid, serial#, username
    FROM   v$session
    WHERE type NOT LIKE 'BACKGROUND';
    

    concerning

  • Replace a table in the table of cluster! Possible?

    Hello

    I had a problem with the insertion of a table that I acquired from an another vi in the existing table in the cluster. My big table contains a set of 5 elements (name, value, save, current and position.) I want to connect my slot vi, whose output is a table of the number, in vi main by replacing only the values in the main draw. All values in the main draw are acquired from sub vi but the rest of the data remains the same. I also want my main table to look the same too, except the values have changed. I know this sounds simple enough, but I don't really know.

    Thanks in advance

    I guess that you need something like that. This will replace the values present in the main table with the values obtained from the Sub vi.

    Good luck

  • Trying to replace a table in a cluster

    I have a table 1 d to a type with a cluster of 5 elements. One of the elements is a picture that I want to replace. Can someone help me understand how to do this?

    Thank you.

    It would work better if you used the same type of data. You a digital picture of the cluster and that you try to replace it with an array of strings.

  • How can I keep the width of the columns (1) and (2) a header when you replace a table?

    I am trying to format a series of paintings using simple Excel files and two columns that look like this:

    Screen Shot 2015-09-07 at 4.04.36 PM.png

    I have already created a table style, but I find myself relating to two additional steps each time I replace the existing data with a new Excel file:

    Challenge #1: Manually set the width of each column to 3 inches.

    Challenge #2: Manually convert the top row a header.

    Each of these tasks only takes a few seconds to set up, but I'll have to make hundreds of them and the time adds up. Here's my existing workflow:

    1. Select the existing table, properly formatted.

    Screen Shot 2015-09-07 at 4.09.59 PM.png

    2 file > Place... (Replace the item selected and The show Import Options checked)

    Screen Shot 2015-09-07 at 4.10.44 PM.png

    3. import in an unformatted Table using the custom Table Style 1 created for this document.

    Screen Shot 2015-09-07 at 4.08.54 PM.png

    Note: Once fell, the width of the previous columns is lost and there is no identified header:

    Screen Shot 2015-09-07 at 4.08.06 PM.png

    4. I manually adjust the width of the columns to 3 inches.

    Screen Shot 2015-09-07 at 4.08.23 PM.png

    5. Finally, I converted the top row a header.

    Screen Shot 2015-09-07 at 4.08.34 PM.png

    Result is a perfectly formatted table, exactly 6 inches wide, each column taking up half the width.

    Screen Shot 2015-09-07 at 4.08.40 PM.png

    Ideas to keep the width of column after replacing the Excel file and/or fit automatically in the top row, as a header would be greatly appreciated!

    Something like this should do the trick. Copy the script in a text editor, save with the extension .jsx and put in your folder of InDesign scripting. If you do this a lot, it would be useful to assign a shortcut to the script key.

    To use, place your cursor in a table cell, or select a cell or a line and run the script.

    //BS"D
    // Copyright (c) 2015 by www.Id-Extras.com
    // Free to use, but please do not remove this notice.
    myTable = app.selection[0].parent;
    if (!myTable instanceof Table){
      myTable = myTable.parent;
    }
    if (!myTable instanceof Table){
      alert("Select a cell or place your cursor in a cell, and try again");
      exit();
    }
    myTable.columns.everyItem().width = "3 in";
    myTable.rows[0].rowType = RowTypes.HEADER_ROW;
    
  • Import and replace the table

    Hello

    I created an application in the apex. How to import a table at the request (I want the new table to replace the old table)? Thank you

    Yes, use the SQL DELETE command to delete the data in your table, and then load the new data through the process of the Apex.

  • In place the structure with replacement of table element uses wrong index

    Hello

    I use the place in structure of elements and notice any strange behavior: if I replace elements in a Subvi and then calling VI, the index is off by one calling VI, most of the time. I saw one or two tracks where the index was correct. Searching for the forums have provided other problems with in place it the structure but not exactly it.

    Attached are a couple of screws demonstrating the problem and some screenshots.

    It seems that you have a problem of optimization of LabVIEW.  It seems that the value of the line is get incremented in your Subvi and that it is somehow going to the main VI.  If you always put a copy in your reset_selections.vi call, I was not able to get the error to occur.  There was a couple of bugs similar to this one.

    You can always add another copy in front of the call to reset_pages.vi, but I never had the problem to occur without it.

    I have attached the modified so VI.

  • Replace the table with Reiunnaitre codes in the model of module BC > online store Layouts

    I'm having a problem in the model of module BC > online store Layouts:

    • Trying to get rid of Table Codes inserted by BC system with the possible list or Div
    • Contact technical support Adobe BC, indicate they use this tag Reiunnaitre in my online store layouts. After, I implemented the codes below, and it does not work. The code of the table is still there on the first page:
      • Here's the code I implemented in the model of module:
        • {tag_productlist, Reiunnaitre (true)}

      • Here are the codes on the first page, you can see that the table is inserted by system of BC:
        • < table class = 'productTable productSmall' > < tbody > < tr > < id td = "catProdTd_9074914" class = "productItem" >
        • < table > < class td = "productItem" > < table > < class td = "productItem" > < table > < class td = "productItem" > < table > < /tr > < / tbody > < / table >

    How could remove the table that insert by BC system? Help, please!

    Hello

    You should consult the tag correctly, information

    http://docs.BusinessCatalyst.com/dev-assets/reference#! / tag-reference/e-commerce/in line-sh op-set - layout.html

    You will see it has many more components to it, you need commas correctly, if you do not specify one of the components let you just white.

    EG - {tag_productlist, 3, 24, alphabetical order, true, true}

  • Need help to replace the tables with CSS

    Having trouble finding how to recreate these stacked boxes:

    http://96.0.181.107/_report-containers.html

    like div using only CSS, keeping the same look/padding.

    I want to close the space between the containers by a few pixels, that I can't do with tables and use the simplest code possible.

    Thank you!

    Try this (view source to see the code)

    http://ALT-Web.com/test/boxes.html

    Nancy O.
    ALT-Web Design & Publishing
    Web | Graphics | Print | Media specialists
    http://ALT-Web.com/
    http://Twitter.com/ALTWEB

  • Select vs nested paging logic table temp

    Hello
    I have several challenges in my selection I'm working on the source table '2-sided"where info is in the same line, so I need to 'strighten' table, selecting information IN and OUT in rows children and then on the last series sorted in the right way, I need to select the number of rows in the range , I came with that select the logic that always down the work because of this nature * in SELECT2.
    I don't know no can do without insertion of ROWNUM, I see that ROWNUM on SELECT2 does not work as expected because of his nature of pseudo...

    I see that I can put the results of SELECT2 in TWG and service with GTT, but it's not sure how effective is.
    Maybe someone can suggest how I can overcome that * obstacle char wild to make it work? On SELECT2 didn't list real column just join with different column names.


    SELECT1 *)
    ROWNUM Select2, * FROM-/ * do not work
    (SELECT3 PRODUCT_ID, IN_COLLIST FROM IN_OUT_TABLE WHERE COND3)
    UNION
    SELECT3 PRODUCT_ID, OUT_COLLIST FROM IN_OUT_TABLE WHERE COND3)
    ORDER BY COL1
    )
    WHERE ROWNUM > = 10 and ROWNUM < = 25



    TX
    Trent

    See if this link helps you in writing a paging query.

    http://asktom.Oracle.com/pls/Apex/f?p=100:11:0:P11_QUESTION_ID:1137577300346084930

    Read the announcement with the heading "Method of paging" July 28, 2010.

  • Table 2d find and replace

    Hi, I'm pretty new to Labview.

    I have a 2D chart...

    I want to be able to search for column 0 for all values in the table.

    If column 0 return values that are the same in the previous row, and then use the last row.

    I will attach a photo with this so that it is easier to understand...

    Column 0:

    500000...

    500000...

    464534...

    500000...

    438251...

    545641...

    438251...

    There are 2 values of '438251' in this table by column 0.

    There are 3 "500000" values in this table by column 0.

    What can I do to replace the table with something like that...

    You want to see in the table

    464534...

    500000...

    545641...

    438251...

    I need to keep all the values in the line that is the very last. I have to delete the whole line values that have the same value in column 0.

    Can someone point me in the right direction with this... Thanks in advance!


  • Replace the subset of table operation

    I have a code to a key VI event down that toggles the visibility of some indicators in response to press the function keys. Records using Boolean shift, the code worked with a few indicators.

    To scale to a large number of indicators, I decided that I would need convert a registry to offset single Boolean array.

    With the shift table Boolean register, for a given function key, the code reverse the Boolean value of the table for the property node Visible, then replaces the same item in the table of Boolean with the inverted Boolean value. The code does not work. Once the indicator is visible, he won't go invisible on the next push of button.

    I watched the execution, display values. Looks like that replace it table subset VI is not replace the Boolean value with the updated value. In the attached screenshot, you can see where I got the element of the array once it has been "updated" to replace table VI of subset. Impossible to find all the bugs in the list of bug LV2013.

    See the attached screenshot. What's wrong with this code? My apologies for the resolution of the screen capture. If necessary, I'll go back to the lab and try to capture a screenshot of higher resolution.

    On-screen turned your empty Boolean arrayis, in other words, it has no elements. Subset of the table Replace does not work with an empty array.

    See you soon,.

    McDuff

Maybe you are looking for

  • I can receive but can't send emails

    I have an Air of IPad and IPhone 6. Both have iOS 9.3.1. I have 2 email on both accounts: one works very well. But the other, BTInternet, I can receive but not send emails from a device because "your user name or password are incorrect.  However, I c

  • my PC turns off randomly

    I have a problem with vista. the computer just turns off randomly for no apparent reason. the machine is a 4 year HP, and he has never done this before. No I turn it off when I'm done and then next turn when I need it, but it just stops different len

  • What is this problem with Verizon abandoned Microsoft Premium

    Verizon reported that they no longer Microsoft Premium with their dsl.  What that means for me?  electronic mail, Favorites, contacts. etc /

  • M177fw does not connect if the WiFi extender is activated

    Main WiFi router's CISCO E4200 WiFi Extender is TP-LINK TL-WPA4220 Printer is HP LaserJet MFP M177fw Pro Date of the firmware: 20130823 Install Smart SW Version: 20/06/2013 1.0.13171.352 Printer is in the same room as the CISCO router.  Extender is l

  • Change IP on ASA 5505

    Hi all I wanted to know if someone can point me in the right direction as how to do below listed issue. I work with a small store in my town and they asked me to do and I didn't do anything until I was sure that I was right in what I was doing. Thank