Collection x temp table - what is the best title?

In which of the structures bellow the performance is better? In the first, I use a collection with forall. In the second, I use a temp table with for loop.
Consider the data to be the same in both the collection and the temp table.
case 1 - collection:
DECLARE
TYPE NumList IS VARRAY(10000) OF NUMBER;
depts NumList := NumList(10, 30, 70 ... 10000); -- department numbers
BEGIN
FORALL i IN depts.FIRST..depts.LAST
DELETE FROM emp WHERE deptno = depts(i);
END;
case 2 - temp table:
-- temp table
create global temporary table depts
num number
-- inserts
insert into depts (num) values (10);
insert into depts (num) values (30);
insert into depts (num) values (10000);
-- code
BEGIN
FOR i IN (select num from depts) LOOP
DELETE FROM emp WHERE deptno = i.num;
END LOOP;
END;

Do you need loop in Case 2?
Wouldn't this do?
DELETE FROM emp WHERE deptno IN (select num from depts);Check this Collections vs table for discussion on similar topic

Similar Messages

  • Auditing tables - What are the best possible ways of doing it?

    Hello Everyone,
    DB version: 10g.
    Brief description of the problem: Right, now I am working on an application which has a java frontend and oracle
    backend. We have no access to the java code at all. So, it is a complete blackbox. . Just wondering, if I could go for a schema level trigger to know, which columns of which tables are altered upon some action at the frontend. Or, if I know the tables specifically, say tab A and tab B; Should I go for a row level trigger on them, instead of going for a
    schema level trigger. Which approach will be the best? If possible, would you please point me to some code samples
    for both of them.
    Thanks.

    http://www.oracle.com/pls/db102/search?remark=quick_search&word=audit&tab_id=&format=ranked

  • I have some custom html5 tables, what's the best way to insert them in to Captivate 8?

    I have four html5 tables styled using css. They function perfectly in a browser - how do I get them into a Captivate slide?

    Hey, I think I’ve managed to crack it. So, I compressed my .html files to zip files. The HTML5 animation feature allows you to import zip files. So I imported the zip files into a Captivate slide and published the project to my desktop. On viewing it worked perfectly – maintaining all CSS. Perfect.
    Thanks for the help,
    Dan

  • What is the best practice for inserting (unique) rows into a table containing key columns constraint where source may contain duplicate (already existing) rows?

    My final data table contains a two key columns unique key constraint.  I insert data into this table from a daily capture table (which also contains the two columns that make up the key in the final data table but are not constrained
    (not unique) in the daily capture table).  I don't want to insert rows from daily capture which already exists in final data table (based on the two key columns).  Currently, what I do is to select * into a #temp table from the join
    of daily capture and final data tables on these two key columns.  Then I delete the rows in the daily capture table which match the #temp table.  Then I insert the remaining rows from daily capture into the final data table. 
    Would it be possible to simplify this process by using an Instead Of trigger in the final table and just insert directly from the daily capture table?  How would this look?
    What is the best practice for inserting unique (new) rows and ignoring duplicate rows (rows that already exist in both the daily capture and final data tables) in my particular operation?
    Rich P

    Please follow basic Netiquette and post the DDL we need to answer this. Follow industry and ANSI/ISO standards in your data. You should follow ISO-11179 rules for naming data elements. You should follow ISO-8601 rules for displaying temporal data. We need
    to know the data types, keys and constraints on the table. Avoid dialect in favor of ANSI/ISO Standard SQL. And you need to read and download the PDF for: 
    https://www.simple-talk.com/books/sql-books/119-sql-code-smells/
    >> My final data table contains a two key columns unique key constraint. [unh? one two-column key or two one column keys? Sure wish you posted DDL] I insert data into this table from a daily capture table (which also contains the two columns that make
    up the key in the final data table but are not constrained (not unique) in the daily capture table). <<
    Then the "capture table" is not a table at all! Remember the fist day of your RDBMS class? A table has to have a key.  You need to fix this error. What ETL tool do you use? 
    >> I don't want to insert rows from daily capture which already exists in final data table (based on the two key columns). <<
    MERGE statement; Google it. And do not use temp tables. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • What's the best way to delete 2.4 million of records from table?

    We are having two tables one is production one and another is temp table which data we want to insert into production table. temp table having 2.5 million of records and on the other side production table is having billions of records. the thing which we want to do just simple delete already existed records from production table and then insert the remaining records from temp to production table.
    Can anyone guide what's the best way to do this?
    Thanks,
    Waheed.

    Waheed Azhar wrote:
    production table is live and data is appending in this table on random basis. if i go insert data from temp to prod table a pk voilation exception occured bcoz already a record is exist in prod table which we are going to insert from temp to prod
    If you really just want to insert the records and don't want to update the matching ones and you're already on 10g you could use the "DML error logging" facility of the INSERT command, which would log all failed records but succeeds for the remaining ones.
    You can create a suitable exception table using the DBMS_ERRLOG.CREATE_ERROR_LOG procedure and then use the "LOG ERRORS INTO" clause of the INSERT command. Note that you can't use the "direct-path" insert mode (APPEND hint) if you expect to encounter UNIQUE CONSTRAINT violations, because this can't be logged and cause the direct-path insert to fail. Since this is a "live" table you probably don't want to use the direct-path insert anyway.
    See the manuals for more information: http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_9014.htm#BGBEIACB
    Sample taken from 10g manuals:
    CREATE TABLE raises (emp_id NUMBER, sal NUMBER
       CONSTRAINT check_sal CHECK(sal > 8000));
    EXECUTE DBMS_ERRLOG.CREATE_ERROR_LOG('raises', 'errlog');
    INSERT INTO raises
       SELECT employee_id, salary*1.1 FROM employees
       WHERE commission_pct > .2
       LOG ERRORS INTO errlog ('my_bad') REJECT LIMIT 10;
    SELECT ORA_ERR_MESG$, ORA_ERR_TAG$, emp_id, sal FROM errlog;
    ORA_ERR_MESG$               ORA_ERR_TAG$         EMP_ID SAL
    ORA-02290: check constraint my_bad               161    7700
    (HR.SYS_C004266) violatedIf the number of rows in the temp table is not too large and you have a suitable index on the large table for the lookup you could also try to use a NOT EXISTS clause in the insert command:
    INSERT INTO <large_table>
    SELECT ...
    FROM TEMP A
    WHERE NOT EXISTS (
    SELECT NULL
    FROM <large_table> B
    WHERE B.<lookup> = A.<key>
    );But you need to check the execution plan, because a hash join using a full table scan on the <large_table> is probably something you want to avoid.
    Regards,
    Randolf
    Oracle related stuff blog:
    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/

  • What is the best way to drop and recreate a Primary Key in the Replication Table?

    I have a requirement to drop and recreate a primary key in a table which is part of Transaction replication. What is the best way to fo it other than remove it from replication and add again?
    Thanks
    Swapna

    Hi Swapna,
    Unfortunately you cannot drop columns used in a primary key from articles in transactional replication.  This is covered in
    Make Schema Changes on Publication Databases:
    You cannot drop columns used in a primary key from articles in transactional publications, because they are used by replication.
    You will need to drop the article from the publication, drop and recreate the primary key, and add the article back into the publication.
    To avoid having to send a snapshot down to the subscriber(s), you could specify the option 'replication support only' for the subscription.  This would require the primary key be modified at the subscriber as well prior to adding the article back in
    and should be done during a maintenance window when no activity is occurring on the published tables.
    I suggest testing this out in your test environment first, prior to deploying to production.
    Brandon Williams (blog |
    linkedin)

  • What is the best way to sync multiple collections of contacts among multiple users?

    (I originally submitted this question under the "Mac OS X Technologies" section, but got no response. I'm submitting a duplicate here because this is where all the smart folks are! My apologies that my question is only partially related to OS X Server . . . )
    What is the best way to sync multiple collections of contacts among multiple users on iOS and OS X?
    For example, suppose I have three collections of contacts: Bob's, Sally's, and Common. I want Bob to be able to access and sync Bob's contacts and Common contacts, and Sally to access and sync Sally's contacts and Common contacts. Bob and Sally never need to access or sync each other's contacts. Bob and Sally would both sync and share contacts in Common.
    How would I best implement this? It's my understanding I have three options for managing contacts across iOS and OS X: 1. iCloud accounts, 2. Install OS X server, or 3. Install and manage Darwin CardDAV directly. Which method would best support what I wish to do?
    I am a seasoned Unix geek well versed in the terminal, so I am prepared to get my hands dirty as much as necessary to achieve what I want. Also, it is sufficient if syncing takes place over WiFi on the local network, in fact, that is desirable versus syncing over the cloud.

    Thanks for your reply Nick101. I see my example was oversimplified. When I say "multiple groups of contacts over multiple users" I'm really referring to N groups of contacts over N users.
    So I need to add Fred, who can access and sync Bob's contacts, Sally's contacts, and Common contacts, as well as Fred's contacts. Can I do it with OS X server?
    You mention you keep your and your partner's contacts administered locally. What keeps you from administering them through OS X server as well?
    I am guessing this can all somehow be accomplished with multiple contact accounts, but I can't find any information on the web explicitly describing this.

  • What is the best way to get data from a spreadsheet into an HTML table?

    I am using libreoffice, and I have it set to collate all the information I enter and output it to a simple table within the program like this:
    http://imageshack.us/a/img717/5144/spreadsheeta.jpg
    I want to get this information after sorting it and put it into the following html table within dreamweaver:
    http://imageshack.us/a/img28/8872/htmls.jpg
    what is the best method for getting the info from A to B?

    before:
    <table id="tbl-m">
              <tr class="tbl-hd">
                <td class="tbl-pos-width">pos</td>
                <td class="tbl-team-width">team</td>
                <td class="tbl-p-w-d-l-p">pld</td>
                <td class="tbl-p-w-d-l-p">won</td>
                <td class="tbl-p-w-d-l-p">drwn</td>
                <td class="tbl-p-w-d-l-p">lost</td>
                <td class="tbl-p-w-d-l-p">pts</td>
              </tr>
              <tr class="tbl-row-b">
                <td class="tbl-pos-width">1</td>
                <td class="tbl-team-width">Team Name 1</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-a">
                <td class="tbl-pos-width">2</td>
                <td class="tbl-team-width">Team Name 2</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-b">
                <td class="tbl-pos-width">3</td>
                <td class="tbl-team-width">Team Name 3</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-a">
                <td class="tbl-pos-width">4</td>
                <td class="tbl-team-width">Team Name 4</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-b">
                <td class="tbl-pos-width">5</td>
                <td class="tbl-team-width">Team Name 5</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-a">
                <td class="tbl-pos-width">6</td>
                <td class="tbl-team-width">Team Name 6</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-b">
                <td class="tbl-pos-width">7</td>
                <td class="tbl-team-width">Team Name 7</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-a">
                <td class="tbl-pos-width">8</td>
                <td class="tbl-team-width">Team Name 8</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-b">
                <td class="tbl-pos-width">9</td>
                <td class="tbl-team-width">Team Name 9</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-a">
                <td class="tbl-pos-width">10</td>
                <td class="tbl-team-width">Team Name 10</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-b">
                <td class="tbl-pos-width">11</td>
                <td class="tbl-team-width">Team Name 11</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-a">
                <td class="tbl-pos-width">12</td>
                <td class="tbl-team-width">Team Name 12</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-b">
                <td class="tbl-pos-width">13</td>
                <td class="tbl-team-width">Team Name 13</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-a">
                <td class="tbl-pos-width">14</td>
                <td class="tbl-team-width">Team Name 14</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-b">
                <td class="tbl-pos-width">15</td>
                <td class="tbl-team-width">Team Name 15</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
              <tr class="tbl-row-a">
                <td class="tbl-pos-width">16</td>
                <td class="tbl-team-width">Team Name 16</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
                <td class="tbl-p-w-d-l-p">0</td>
              </tr>
            </table>
    after:
    <table>
              <tr>
                <td>Pos</td>
                <td>Team</td>
                <td>Pld</td>
                <td>Won</td>
                <td>Drwn</td>
                <td>Lost</td>
                <td>Pts</td>
              </tr>
              <tr>
                <td>1</td>
                <td>Team 1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>2</td>
                <td>Team 2</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>3</td>
                <td>Team 3</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>4</td>
                <td>Team 4</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>5</td>
                <td>Team 5</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>6</td>
                <td>Team 6</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>7</td>
                <td>Team 7</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>8</td>
                <td>Team 8</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>9</td>
                <td>Team 9</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>10</td>
                <td>Team 10</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>11</td>
                <td>Team 11</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>12</td>
                <td>Team 12</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>13</td>
                <td>Team 13</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>14</td>
                <td>Team 14</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>15</td>
                <td>Team 15</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
              <tr>
                <td>16</td>
                <td>Team 16</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
                <td>1</td>
              </tr>
            </table>

  • What is the best way to declare field length 500 in internal table?

    Hi all,
    what is the best way to declare field length 500(constant value allways) in internal table?
    I am trying to send data from internal table to file format, and I have a field in internal table with 500 length (constant value always). So how do I can declare and append this field value to table?
    Thanks
    Murali

    Hi.  Please see the following example program, notice how I am filling the field with the constant value.
    report zrich_0001.
    *       CLASS lcl_main DEFINITION
    class lcl_main definition.
      public section.
        types: begin of ttab,
                fld1(500) type c,
               end of ttab.
        data: itab type table of ttab.
        data: xtab type ttab.
        methods: constructor,
                 write_itab.
    endclass.
    *       CLASS lcl_main IMPLEMENTATION
    class lcl_main implementation.
      method constructor.
    <b>
        xtab-fld1 =
          'This is one part of the total string which needs to be really' &
          ' long and this is a constant and we need to move it to a work' &
             ' area and then append it to the internal table which has a' &
              ' field with a length of five hundred characters'.
        append xtab to itab.</b>
      endmethod.
      method write_itab.
        loop at itab into xtab.
          write:/ xtab-fld1.
        endloop.
      endmethod.
    endclass.
    data: o_main type ref to lcl_main.
    start-of-selection.
      create object o_main.
      call method o_main->write_itab.
    Regards,
    Rich Heilman

  • What is the best practice for creating primary key on fact table?

    what is the best practice for primary key on fact table?
    1. Using composite key
    2. Create a surrogate key
    3. No primary key
    In document, i can only find "From a modeling standpoint, the primary key of the fact table is usually a composite key that is made up of all of its foreign keys."
    http://download.oracle.com/docs/cd/E11882_01/server.112/e16579/logical.htm#i1006423
    I also found a relevant thread states that primary key on fact table is necessary.
    Primary Key on Fact Table.
    But, if no business requires the uniqueness of the records and there is no materilized view, do we still need primary key? is there any other bad affect if there is no primary key on fact table? and any benifits from not creating primary key?

    Well, natural combination of dimensions connected to the fact would be a natural primary key and it would be composite.
    Having an artificial PK might simplify things a bit.
    Having no PK leads to a major mess. Fact should represent a business transaction, or some general event. If you're loading data you want to be able to identify the records that are processed. Also without PK if you forget to make an unique key the access to this fact table will be slow. Plus, having no PK will mean that if you want to used different tools, like Data Modeller in Jbuilder or OWB insert / update functionality it won't function, since there's no PK. Defining a PK for every table is a good practice. Not defining PK is asking for a load of problems, from performance to functionality and data quality.
    Edited by: Cortanamo on 16.12.2010 07:12

  • What is the best alternative to exclude results from a specific site collection

    Hi,
    We want to exclude results from a specific site collection (for example http://server/sites/demo").
    A few ways are being considered:
    1. Copy the Local SharePoint Results Result Source and edit it not to include results from that site collection and then set the new custom result source as default.
    2. Edit the Search Results WP in the "Everything" tab to exclude those results (edit the query there)
    3. Set a query rule on "Local SharePoint Results" to exclude the results from the Demo Site Collection
    What is the best?
    keren tsur

    Hi Keren,
    Modifying the Local result  xlt will give you the most granularity but it is also arguably more challenging because of the "editing code" portion
    On your search page you could append a query string via the search webpart but that may not get granular enough.
    In the past I have used search scopes to exclude items in search results. Depending on the specific requirement it may be a quick and easy way to accomplish your task. it really depends on how ganular you need to get with excluding items from results.
    A search scope can be setup be going to:
    1. Site Actions (of the site collection you want to apply this to)
    2. Click on Site Settings
    3. Under site Collection Administration ( you have to be a site collection admin or farm admin to be able to see this section)
    4. click on "Search Scopes"
    5. Click on New Scope
    6. Name it, fill out any other options you want and click "ok"
    7. Click on your newly created search scope.
    8. click on "new rule"
    9. Fill out the fields based on your requirements and then click "OK"
    10. I believe you will want to wait for a search to index to run before this scope will return any results.
    Please let me know if you have any other questions.
    Good Luck!
    Alex

  • What is the best way to handle collections that contains different object

    Hi
    Suppose i have two class as below
    class Parent {
           private String name;
    class Child extends Parent {
          private int childAge;
    }I have a list that can contains both Child and Parent Object but in my jsp i want to display a childAge attribute ( preferrably not to use scriplet )
    what is the best way to achieve this?

    Having a collection containing different object types is already a bad start.
    How are parent and child related to each other? Shouldn't Child be a property of Parent?
    E.g.public class Parent {
        private Child child;
    }In any way, you could in theory just check Object#getClass()#getName(), but this is a nasty design.

  • I would like to put the results of a proc on a local database into a table in my azure db. What is the best way to do this?

    I would like to put the results of a proc on a local database into a table in my azure db.  What is the best way to do this?  I dont see the ability to link.  The local db is on my desktop and is mssql12.
    McC

    I am not sure if i set up the linked server correctly here is the schema and an attempt to run a select and the resulting error:
    SELECT  *
    FROM  [CN5E6E9LM2.DATABASE.WINDOWS.NET,1433].[Mkerr_db].dbo.addr
    OLE DB provider "SQLNCLI11" for linked server "CN5E6E9LM2.DATABASE.WINDOWS.NET,1433" returned message "Unspecified error".
    Msg 40515, Level 16, State 2, Line 1
    Reference to database and/or server name in 'Mkerr_db.sys.sp_tables_info_90_rowset_64' is not supported in this version of SQL Server.
    McC

  • What's the best way to reorganize table or tablespace?

    Hi,
    I have a db of Oracle 9ir2, and it works 24*7.
    So I can't shut it down to do reorganization.
    I have known some ways to do, like exp/imp, CTAS, alter table move ...etc.
    Anybody can tell me what is the best way to do reorganization online.
    And what advantages and disvantages in that ways.
    Thanks & regards

    every approch as its pros and cons.
    For an example, exp/imp, you need to take the export, drop the schema, create schema with all required privileages and then import.
    CATS, generats a lot of redo, and then, you need to re-create their intigrity constraints and other stuff.
    alter table move.. also generates a lot of redo, apart from them, you need to rebuild indexes.
    I have the same situation in office and I do the third option, which is alter table move. I wrote my own scrit as following description.
    In first loop I move a single and then, in the inner loop, I rebuild all indexes of this table, so that other tables are accessable and then so on. I have had no problems.
    If you want this script mail me @ [email protected], I will send you the script.
    Jaffar

  • What is the best way of selecting 99 colums from a table with 100 colums?

    Hi All,
    Suppose in a table T, I have 100 colums .I want to select 99 columns.So what is the best way to do the same?
    Anyone Help!
    Thanx in advance.
    Piyush

    Try this
    SQL> ed
    Wrote file afiedt.buf
      1  select column_name ||',
      2  ' from user_tab_columns
      3  where
      4     table_name = 'EMP'
      5*    and column_name not like 'EMPNO'
    SQL> /
    COLUMN_NAME||','
    ENAME,
    JOB,
    MGR,
    HIREDATE,
    SAL,
    COMM,
    DEPTNO,
    7 rows selected.
    SQL>

Maybe you are looking for

  • Unable to launch application error

    Everytime I try to open a jnlp file i get the Unable to launch application error. I have no clue how to fix this and would like to know a solution. I currently have JRE 6 Update 6. Here is the error info. java.lang.Exception: cache failed forhttp://p

  • Z table middleware replication from R/3 to CRM

    Looking for a CRM Middleware Guru out there !!! I'm trying to replicate a simple R/3 table (list of countries in my example below. The replication must include both initial and delta downloads. My problem is the following: When doing an initial load

  • Parsing Xml using Jdom

    Hi all, I am reposting it as I was told to format the code and send it again. I am trying to parse a xml file using a jdom java code.This code works fine if I remove xmlns attribute in the root element. (I get the expected result) .If the "xmlns" att

  • Flash animation dropping down

    Here's my site: http://www.barristerdigital.com/ My flash animation has dropped down out of the blue bar I set up and I'm not sure why. I'm open and grateful for any suggestions.

  • How to allow internet pages to use their own background colors ?

    On my old Win7Pro system (Firefox stepwise updated from early version 2 to version 18.0) this works perfectly: for example my own homepage http://www.du-ch.net/ shows its light blue background color. However, on my new Win8Pro laptop with Firefox 18.