One SQL Statement

I have a text column with values like listed below:
rec_num text_column
10001 'Today_is__my_birthday.'
10002 'I have__a___dog_and_a____cat.'
where '_' indicates space.
How can I use one SQL 'select ....' statement to get rid of the multiple spaces and replace with just one space?
I expect a result like 'Today is my birthday.' or 'I have a dog and a cat.' with just one space between word.
THANKS a million.

Hi,
SELECT     rec_num
,     REGEXP_REPLACE ( text_column
                 , ' +'          - or ' {2,}'
FROM    table_x;As you've noticed, this site compresses white space by default.
To post formatted text, type these 6 characters:
{code}
(small letters only, inside curly brackets) before and after sections of formatted text, to preserve spacing.

Similar Messages

  • How can i use one SQL statement to solve problem?

    How can i use one SQL statement to solve the question below?
    For a Table named A, there is a column named F(char type).
    Now select all the records where F like '%00' and update their F value to '%01'
    Just one SQL statement.Do not use PL/SQL block.
    How to do that?
    Thanks.

    What is the data volume for this table?
    Do you expect lots of rows to have '%00' as their value?
    Following two statements come to mind. Other experts would be able to provide better alternatives:
    If you have index on SUBSTR(f, 2):
    UPDATE A
    SET    f = SUBSTR(f,
                      1,
                      length(f) - 2) || '01'
    WHERE  substr(f,
                  -2) = '00';If most of the rows have pattern '%00':
    UPDATE A
    SET    f = SUBSTR(f,
                      1,
                      length(f) - 2) ||
               DECODE(SUBSTR(f,
                             -2),
                      '00',
                      '01',
                      SUBSTR(f,
                             -2));

  • Can you really update two tables in one SQL statement

    Ok a post in the forum has got me awefully curious:
    Can you update two tables in one update statement i.e something like this
    update table a , b
    set b.<column> = something
    a.<column> = something
    Something to this effect.
    If you are curious to know what post I am talking about it is called "updating a single row"

    No. You can only update one table in one SQL statement.

  • Getting A Count In One SQL Statement

    Since I don't know how to do what I'm about to ask, I would normally create a table (tbl1) with the main dataset I want and then create a second table (tbl2) with additional data I want, join the two and update tbl1 data with tbl2 data.
    However, I would like to know how to do this in one SQL statement. I somehow need to link the count sql with the main body..?
    So..I have to pull data by group id. Each group id can have a certain number of active members in it. I would like to use one SQL statement to pull the group id's and also, at the same time, give me a count of each group's active membership. Both the main and count statments in the below SQL include the emp_grps table which can obviously be linked so the right groups are updated..
    Not sure how to begin to reflect this in an SQL statement, so I'll just give you the wrong version to show what data elements I have. The following gives the total count by all group's in each groups individual record. Of course, as mentioned, all I want is that group's share of the membership in their individual record:
    select group_id,
    (select count(*)
    from elig elg
    join emp_grps eg
    on elg.group_id = eg.group_id
    where eg.rmc_code in ('CR')
    and elg.elig_start_date < sysdate
    and elg.elig_end_date > sysdate) mbr_count
    from odw.emp_grps eg
    where eg.rmc_code in ('1M')
    Output from this query:
    GROUP_ID MBR_COUNT
    A 10,000
    B 10,000
    C 10,000
    D 10,000
    What I want to see:
    GROUP_ID MBR_COUNT
    A 7,000
    B 1,000
    C 1,500
    D 500
    Thanks for any assistance..

    Hi,
    So you want one row for every distinct value of group_id, with a count that reflects just that group_id.
    That sound like a job for GROUP BY group_id and the aggregate COUNT function, like this:
    SELECT    eg.group_id
    ,       COUNT ( CASE
                      WHEN  eg.rmc_code  IN ('CR')
                    THEN  1
                  END
                )     AS mbr_count
    FROM        elig           elg
    JOIN       emp_grps      eg    ON   elg.group_id  = eg.group_id
    WHERE       eg.rmc_code             IN ('CR', '1M')
    AND       elg.elig_start_date < SYSDATE
    AND       elg.elig_end_date   > SYSDATE
    GROUP BY  eg.group_id
    HAVING       COUNT ( CASE
                      WHEN  eg.rmc_code  IN ('1M')
                    THEN  1
                  END
                ) > 1
    ORDER BY  eg.group_id
    ;It's unclear what you're trying to do with eg.rmc_code. I'm guessing you want to count the rows where it's one value ('CR'), but only display groups that also have another value ('1M').
    Of course, I can't say for sure without seeing your actual tables, or at least small test versions of them.
    Post CREATE TABLE and INSERT statements (relevant columns only) for all tables involved, and the resutls you want from that sample data (if it's not the results you already posted).
    Always say which version of Oracle you're using.

  • Execute just that one SQL statement ....

    Would like to request to add running just that one sql statement in the statment worksheet which has your cursor in it without having to select the entire statement.
    Updating any part of a statement deselects it ..... reselecting a larger statement is cumbersome and time consuming
    Regards
    Ronald

    There are some problems with the statement selection (as per the other reply) but you can run just the current statement that the cursor is in, with the F9 or the Run Statement button on the SQL Worksheet.
    If you are used to using TOAD where blank lines are seperators, remember that Raptor expects you to terminate your SQL statements with a ; and your PL/SQL statements with a / (on a new line).

  • Performance Issue using min() and max() in one SQL statement

    I have a simple query that selects min() and max() from one column in a table in one sql statment.
    The table has about 9 Million rows and the selected column has a non unique index. The query takes 10 secs. When i select min() and max() in separate statements, each takes only 10 msecs:
    This statement takes 10 secs:
    select min(date_key) , max(date_key)
    from CAPS_KPIC_BG_Fact_0_A
    where date_key != TO_DATE(('1900-1-1' ),( 'YYYY-MM-DD'))
    This statement takes 10 msecs:
    select min(date_key)
    from MYTABLE
    where date_key != TO_DATE(('1900-1-1' ),( 'YYYY-MM-DD'))
    union all
    select max(date_key) from MYTABLE
    Because the first statement is part of an autmatic generated SQL of an application, i can't change it and i have to optimize the data model. How can i speed up the first statement?

    I've ran similar query on a table that has 10 milliion rows, with an index on the date column
    This is what I have found:
    SQL> set timing on
      1  SELECT MIN(ID_DATE) MIN_DATE, MAX(ID_DATE) MAX_DATE
      2      FROM MY_DATE
      3*     WHERE ID_DATE != TO_DATE(('1900-1-1' ),( 'YYYY-MM-DD'))
    SQL> /
    MIN_DATE  MAX_DATE
    03-APR-76 06-JAN-02
    real: 43383
    SQL> SELECT MIN(ID_DATE) MIN_DATE FROM MY_DATE
      2   WHERE ID_DATE != TO_DATE(('1900-1-1' ),( 'YYYY-MM-DD'))
      3  UNION ALL
      4  SELECT MAX(ID_DATE) MAX_DATE FROM MY_DATE
      5   WHERE ID_DATE != TO_DATE(('1900-1-1' ),( 'YYYY-MM-DD'))
      6  /
    MIN_DATE
    03-APR-76
    06-JAN-02
    real: 20
    SQL> SELECT MIN_DATE, MAX_DATE FROM
      2  (SELECT MAX(ID_DATE) MAX_DATE FROM MY_DATE
      3  WHERE ID_DATE != TO_DATE(('1900-1-1' ),( 'YYYY-MM-DD')) ) A,
      4  (SELECT MIN(ID_DATE) MIN_DATE FROM MY_DATE
      5  WHERE ID_DATE != TO_DATE(('1900-1-1' ),( 'YYYY-MM-DD')) ) B
      6  /
    MIN_DATE  MAX_DATE
    03-APR-76 06-JAN-02
    real: 10
    SQL> My conculsion, there is nothing you can do to the tables that will improve that particular statement.
    Why can't you modify the application?

  • One SQL Statement executed abnormally in Oracle10g Database

    One programmer sent the following SQL to me, and ask why no result was returned. I knew that the SQL Statement was not good in writting and designing.
    So, first we don't focus on it. we only focus on why no result was returned.
    SELECT 'other Accts', 'Other Accts', TO_NUMBER(''),TO_DATE('2010-10-9', 'yyyy-MM-dd')
    FROM dual
    WHERE *0 = (SELECT COUNT(*)*
    FROM (SELECT 'other Accts', 'Other Accts',SUM(a.qty_invoiced), a.sell_week_date
    FROM sales_in_oracle_data a
    WHERE NOT EXISTS
    (SELECT pa.partner_number
    FROM partner pa
    WHERE pa.partner_number = a.customer_number)
    AND a.sell_week_date >=TO_DATE('2010-10-9', 'yyyy-MM-dd')
    AND a.sell_week_date <=TO_DATE('2011-1-1', 'yyyy-MM-dd')
    AND a.qty_invoiced >= 0
    AND EXISTS
    (SELECT pp.product_id
    FROM product_pn pp, product p
    WHERE pp.magellan_pn = a.material
    AND pp.product_id = p.product_id )
    GROUP BY a.sell_week_date
    the SQL sub Statement:
    SELECT COUNT(*)*
    FROM (SELECT 'other Accts', 'Other Accts',SUM(a.qty_invoiced), a.sell_week_date
    FROM sales_in_oracle_data a
    WHERE NOT EXISTS
    (SELECT pa.partner_number
    FROM partner pa
    WHERE pa.partner_number = a.customer_number)
    AND a.sell_week_date >=TO_DATE('2010-10-9', 'yyyy-MM-dd')
    AND a.sell_week_date <=TO_DATE('2011-1-1', 'yyyy-MM-dd')
    AND a.qty_invoiced >= 0
    AND EXISTS
    (SELECT pp.product_id
    FROM product_pn pp, product p
    WHERE pp.magellan_pn = a.material
    AND pp.product_id = p.product_id )
    GROUP BY a.sell_week_date
    it returned 0 truely. But the entire SQL didn't return any data.
    why can it execute like above description?  I guess that it maybe go against oracle basic rule.
    Any one give me some suggestion?
    Edited by: [email protected] on 2010/7/19 下午 6:09

    I managed to track down a 10.2.0.4 instance and can confirm that this statement does not return the correct results.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> select *
      2  from   dual
      3  where  0 = (select count(*)
      4              from  (select dummy, sum(1)
      5                     from   dual
      6                     where  dummy = 'z'
      7                     group  by dummy
      8                    )
      9             );
    no rows selected
    SQL> explain plan for
      2  select *
      3  from   dual
      4  where  0 = (select count(*)
      5              from  (select dummy, sum(1)
      6                     from   dual
      7                     where  dummy = 'z'
      8                     group  by dummy
      9                    )
    10             );
    Explained.
    | Id  | Operation           | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT    |      |     1 |     2 |     4   (0)| 00:00:01 |
    |*  1 |  FILTER             |      |       |       |            |          |
    |   2 |   TABLE ACCESS FULL | DUAL |     1 |     2 |     2   (0)| 00:00:01 |
    |   3 |   SORT AGGREGATE    |      |     1 |     2 |            |          |
    |*  4 |    TABLE ACCESS FULL| DUAL |     1 |     2 |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter( NOT EXISTS (SELECT /*+ */ 0 FROM "SYS"."DUAL" "DUAL"
                  WHERE "DUMMY"='z'))
       4 - filter("DUMMY"='z')
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, Real Application Clusters, OLAP, Data Mining
    and Real Application Testing options
    SQL> select *
      2  from   dual
      3  where  0 = (select count(*)
      4              from  (select dummy, sum(1)
      5                     from   dual
      6                     where  dummy = 'z'
      7                     group  by dummy
      8                    )
      9             );
    D
    X
    SQL> explain plan for
      2  select *
      3  from   dual
      4  where  0 = (select count(*)
      5              from  (select dummy, sum(1)
      6                     from   dual
      7                     where  dummy = 'z'
      8                     group  by dummy
      9                    )
    10             );
    Explained.
    | Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |      |     1 |     2 |     6   (0)| 00:00:01 |
    |*  1 |  FILTER            |      |       |       |            |          |
    |   2 |   TABLE ACCESS FULL| DUAL |     1 |     2 |     3   (0)| 00:00:01 |
    |*  3 |   TABLE ACCESS FULL| DUAL |     1 |     2 |     3   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter( NOT EXISTS (SELECT 0 FROM "SYS"."DUAL" "DUAL" WHERE
                  "DUMMY"='z'))
       3 - filter("DUMMY"='z')
    17 rows selected.Notice that the explain plan is a bit different compared to the 11.2.0.1 release. My guess is that the optimizer is doing something weird.

  • How to generate synthetic rows (raw(16) guid cols) in one SQL statement?

    We're populating a table containing two GUID columns:
    create table object
    ( object_guid raw(16) primary key
    , project_guid raw(16)
    )All object GUIDs are unique (thus the PK), and each object belongs to a given project (should be a FK to some project table). We want N objects / rows, belonging to only 100 projects, i.e. 1% of the rows of the object table belong to the project #1, 1% to #2, etc...
    Right now we're using about 25 lines of C++/OCI code to do that (one query doing a "select sys_guid() from dual", and using the generated GUIDs to do inserts into object), but I suspect it's possible to do this using a single SQL statement using mysterious connect by or some other Oracle SQL magic. (our OCI code does quite a few round-trips to do the equivalent).
    Would anyone please demonstrate how to generate the rows as explained above, and possibly describe how it works for the non-initiated?
    Thanks, --DD
    PS: I'm sure it can be done in PL/SQL as well, but I'm interested in a SQL version if one's possible.

    I've found two ways, both taking a few SQL statements, but somehow I think this ought to be possible without intermediary tables... I'm sure there's a better way.
    #1drop   table project_tmp;
    create table project_tmp
    as select rownum pid, sys_guid() guid from dual
    connect by level <= 100;
    drop   table object_tmp;
    create table object_tmp
    as select mod(rownum, 100) + 1 pid, sys_guid() guid from dual
    connect by level <= 1000;
    drop   table object;
    create table object
    as select o.guid object_guid, p.guid project_guid
    from object_tmp o, project_tmp p
    where o.pid = p.pid;
    drop table project_tmp;
    drop table object_tmp;#2:drop table project;
    create table project
    as select mod(rownum, 100) + 1 prj_id, sys_guid() guid from dual
    connect by level <= 100;
    drop table object;
    create table object
    as select mod(rownum, 100) + 1 prj_id, sys_guid() object_guid from dual
    connect by level <= 1000;
    alter table object add project_guid raw(16);
    update object o set o.project_guid = (select guid from project p where p.prj_id = o.prj_id);
    drop table project;
    alter table object drop column prj_id;Verification:select count(distinct project_guid) from object;
    select project_guid, count(OBJECT_GUID) from object group by project_guid;

  • How to insert 22.5K rows in one sql statement in Oracle

    Hi Gurus,
    I have a one table with one column. I require to input 22.5k numbers example "08323459" in that table. Can anyone tell me how to insert those 22.5K numbers with one sql command.
    I am using PL/SQL client. And oracle version is 11G.

    If you have an Excel file, the simplest approach is generally to save the file as a CSV, copy it to the database server, create an external table that exposes the file as a table, and then write your INSERT by selecting the data from the external table.
    INSERT INTO permanent_table( column_name )
      SELECT column_name
        FROM external_tableAssuming you have SQL*Loader installed on your client machine, you could also use SQL*Loader to read the data in the file and load it into the database table.
    Justin

  • Combine two select statements in one SQL statements

    I have the following two queries that I need to combine into one query, where it updates a single row at the same time.
    SELECT count(*) FROM database.USAGE WHERE SERVICE_TYPE = 'C' AND ACCOUNT = "4837"
    SELECT sum(minutes) FROM database.USAGE WHERE SERVICE_TYPE = 'DA' AND ACCOUNT = "4837"
    I want to insert the values of each select statement into two columns of the same row, as well as insert the account number from the select statement.
    After the query has been executed, the database row will look like this:
    ACCOUNT COUNT SUM
    4837 354 1039202
    I am looking for suggestions on how to:
    - either combine the two into one query
    - simply update each column with the value from each query by updating the row with the account value
    I am a SQL newbie - so I appreciate any assistance.
    Thanks,
    Tony

    Hi, Tony,
    When you're talking about changing the data in tables, "INSERT" means to add a new row, and you'll cause a lot of confusion if you use it to mean something else. So don't say
    "I want to insert the values of each select statement into two columns..."; use some other word, like:
    "I want to put the values of each select statement into two columns ..."
    If you happened to know that those two numbers were 354 and 1039202, you might say:
    UPDATE  table_x
    SET     a_count = 354
    ,       a_sum = 1039202
    WHERE   account = 4837;But you don't know the numbers; you want to have the query figure out what they are.
    In most places where you can use a literal (like 354 or 1039202), you can also use a scalar sub-query, a SELECT statement, enclosed in parentheses, that produces one column and (at most) one row.
    In your case, you can say:
    UPDATE  table_x
    SET     a_count = (SELECT count(*) FROM database.USAGE WHERE SERVICE_TYPE = 'C' AND ACCOUNT = 4837)
    ,       a_sum = (SELECT sum(minutes) FROM database.USAGE WHERE SERVICE_TYPE = 'DA' AND ACCOUNT = 4837
    WHERE   account = 4837;or, to make it more readable:
    UPDATE  table_x
    SET     a_count =
    ( SELECT count (*)
    FROM database.USAGE
    WHERE SERVICE_TYPE = 'C'
    AND ACCOUNT = 4837
    ,       a_sum =
    ( SELECT sum (minutes)
    FROM database.USAGE
    WHERE SERVICE_TYPE = 'DA'
    AND ACCOUNT = 4837
    WHERE   account = 4837;By the way, why are you using double-quotes around 4837? If it's a string, enclose it in single quotes. If it's a number (which I'm assuming in my code), don't enclose it in anything.
    WARNING: scalar sub-queries are somewhat like duct tape: they're extremely useful in certain places, and those places account for about 1% of their use. The other 99% of the time, there's a better way to do things, though the better way may require more expertise.

  • Insert multiple rows with one sql statement in access

    Hi,
    I'm trying to copy a table into another. What I want to do is to use "Insert into table1 select * from table2 where field > val". Something like that. I know a lot of databases support it. I was wondering if ms access ODBC driver also supports it. I searched quite a bit and haven't found a definitive answer on this.
    Thank you

    Yes, M$ Access 2000 supports it. This is from their help:
    INSERT INTO Statement
    Adds a record or multiple records to a table. This is referred to as an append query.
    Syntax
    Multiple-record append query:
    INSERT INTO target [(field1[, field2[, ...]])] [IN externaldatabase]
    SELECT [source.]field1[, field2[, ...]
    FROM tableexpression
    Single-record append query:
    INSERT INTO target [(field1[, field2[, ...]])]
    VALUES (value1[, value2[, ...])
    The way you've written the INSERT, table1 and table2 have to have the same # of columns and the same types, of course.

  • Can I have many sdo_joins in one SQL statement?

    Hi guys,
    Can I have a join like this.I do not want to have the normal sql joins, i would liek my query in spatial.But I have error missing expression.Anything wrong I am doing?
    select a.esa_code,b.esa_code,f.esa_code
    FROM TABLE (sdo_join('opel_exch','geoloc',
    'aus_esa','geoloc',
    'mask =ANYINTERACT'))c,
    (sdo_join('aus_dalpg','geoloc',
    'aus_esa','geoloc',
    'mask =ANYINTERACT'))d,
    opel_exch a ,
    aus_esa b,
    aus dalpg f
    where c.rowid1=a.rowid and c.rowid2=b.rowid
    and c.rowid1=b.rowid and d.rowid2=f.rowid
    order by a.esa_code;
    OPEL_EXCh=POINT
    AUS_ESA=POLY & MULTIPOLY
    AUS_DALPG =POLY

    This could be due to the missing TABLE function on the second SDO_JOIN

  • Script error - Inserting multiple rows in one SQL statement.

    Hi,
    Tried using INSERT ALL INTO command inside Script. But getting below error.
    Oracle <> error message for operation <OCIStmExecute>: <ORA-00928: missing SELECT keyword>.
    Same query with single insert statement runs fine without any issues.
    Oracle eg:
    INSERT ALL
        INTO item (title) VALUES ('title5')
        INTO item (title) VALUES ('title6')
        INTO item (title) VALUES ('title7')
    SELECT * FROM dual;
    Appreciate your suggestions.
    Thx

    Hi,
    Actual syntax is as below:
    INSERT ALL
      INTO suppliers (supplier_id, supplier_name) VALUES (1000, 'IBM')
      INTO suppliers (supplier_id, supplier_name) VALUES (2000, 'Microsoft')
      INTO suppliers (supplier_id, supplier_name) VALUES (3000, 'Google')
    SELECT * FROM dual;
    Now in your non working query, you have applied comma after first INTO statement.
    Please remove it.
    Thanks,
    Swapnil

  • Multiple Oracle SQL statements in one Add Command

    I am creating a report that needs a bunch of processing(SQL DDL statements) before the final select statement is generated for the report.
    I am connecting to Oracle database however Crystal Report only allows me to give one SQL statement in one Add Command.
    Is there a way to give multiple statements in one "Add Command" for the report ?
    Thanks.

    you can add more than one "Add Command" in the same report, and you can also treat them as views or table, so you can link them to each others and so on
    good luck

  • Problem with sql statement after migration

    Hi, recently I copied a production database X to a remote location, to serve as a test upgrade database. Original is 32 bit and test database is 64 bit. After migration it turned out that one sql statement consumed much more CPU during EXECUTE phase than on production database. Explain plans are the same. Why CPU is different? How can I trace the problem?
    ORIGINAL SERVER TKPROF OUTPUT:
    call count cpu elapsed disk query current rows
    Parse 1 0.12 0.33 0 0 2 0
    Execute 1 542.60 2165.29 2 6 0 0
    Fetch 0 0.00 0.00 0 0 0 0
    total 2 542.73 2165.62 2 6 2 0
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 66 (SPB)
    Rows     Row Source Operation
          0  SORT UNIQUE (cr=6 pr=2 pw=0 time=719909655 us)
          0   FILTER  (cr=6 pr=2 pw=0 time=719909615 us)
          2    NESTED LOOPS  (cr=0 pr=0 pw=0 time=719895787 us)
          2     HASH JOIN  (cr=0 pr=0 pw=0 time=719881575 us)
          2      NESTED LOOPS  (cr=0 pr=0 pw=0 time=1210563833 us)
          2       NESTED LOOPS  (cr=0 pr=0 pw=0 time=1210549798 us)
          2        NESTED LOOPS  (cr=0 pr=0 pw=0 time=1210519159 us)
    330261         REMOTE  TWFLPROCESSINSTANCES (cr=0 pr=0 pw=0 time=29176788 us)
          2         REMOTE  TAMCONTRACTEDITEMD (cr=0 pr=0 pw=0 time=1177866001 us)
          2        REMOTE  TAMPROPVALUES (cr=0 pr=0 pw=0 time=30580 us)
          2       REMOTE  TREPVALUELISTITEMS (cr=0 pr=0 pw=0 time=13973 us)
    24542745      REMOTE  TAMCONTRACTEDITEMD (cr=0 pr=0 pw=0 time=638116004 us)
          2     REMOTE  TWFLPROCESSINSTANCES (cr=0 pr=0 pw=0 time=14154 us)
          2    INDEX RANGE SCAN IDX_PROCES_ID (cr=6 pr=2 pw=0 time=13706 us)(object id 546934)
    Rows     Execution Plan
          0  INSERT STATEMENT   MODE: ALL_ROWS
          0   SORT (UNIQUE)
          0    FILTER
          2     NESTED LOOPS
          2      HASH JOIN
          2       NESTED LOOPS
          2        NESTED LOOPS
          2         NESTED LOOPS
    330261          REMOTE OF 'TWFLPROCESSINSTANCES' (REMOTE)
                         [T6STDBY.WR]
                        SELECT /*+ OPAQUE_TRANSFORM */ "ID","STATUS","STARTDATE"
                        FROM "DIALOG6"."TWFLPROCESSINSTANCES" "PI" WHERE
                          "STATUS"<>'A' AND "STATUS"<>'N' AND "STARTDATE">=:1-30
          2          REMOTE OF 'TAMCONTRACTEDITEMD' (REMOTE)
                         [T6STDBY.WR]
                        SELECT /*+ OPAQUE_TRANSFORM */ "CITEM_ID","ROOTCITEM_ID",
                        "PRODUCT_ID","CONTRACT_ID" FROM
                        "DIALOG6"."TAMCONTRACTEDITEMD" "CI" WHERE "PRODUCT_ID"=
                          934 AND "CONTRACT_ID"=:1
          2         REMOTE OF 'TAMPROPVALUES' (REMOTE) [T6STDBY.WR]
                       SELECT /*+ OPAQUE_TRANSFORM */ "PROPERTY_ID",
                       "VALUEOBJECT_ID","CONTRACTEDITEM_ID","DTO","ISVALID"
                       FROM "DIALOG6"."TAMPROPVALUES" "TV" WHERE "DTO" IS NULL
                       AND "ISVALID"='Y' AND "CONTRACTEDITEM_ID"=:1 AND
                         "PROPERTY_ID"=930326
          2        REMOTE OF 'TREPVALUELISTITEMS' (REMOTE) [T6STDBY.WR]
                      SELECT /*+ OPAQUE_TRANSFORM */ "ID","NAME" FROM
                        "DIALOG6"."TREPVALUELISTITEMS" "TVL" WHERE "ID"=:1
    24542745       REMOTE OF 'TAMCONTRACTEDITEMD' (REMOTE) [T6STDBY.WR]
                     SELECT /*+ OPAQUE_TRANSFORM */ "CITEM_ID","CONTRACT_ID" FROM
                       "DIALOG6"."TAMCONTRACTEDITEMD" "CINAD"
          2      REMOTE OF 'TWFLPROCESSINSTANCES' (REMOTE) [T6STDBY.WR]
                    SELECT /*+ OPAQUE_TRANSFORM */ "ID" FROM
                    "DIALOG6"."TWFLPROCESSINSTANCES" "SYS_ALIAS_1" WHERE "ID"=
                      :1
          2     INDEX   MODE: ANALYZED (RANGE SCAN) OF 'IDX_PROCES_ID'
                    (INDEX)
    REMOTE SERVER TKPROF OUTPUT:
    call count cpu elapsed disk query current rows
    Parse 1 0.15 0.15 0 0 2 0
    Execute      1   1210.69    3831.70          0          6          0           0
    Fetch 0 0.00 0.00 0 0 0 0
    total 2 1210.85 3831.85 0 6 2 0
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 66 (SPB)
    Rows     Row Source Operation
          0  SORT UNIQUE (cr=6 pr=0 pw=0 time=681448432 us)
          0   FILTER  (cr=6 pr=0 pw=0 time=681448397 us)
          2    NESTED LOOPS  (cr=0 pr=0 pw=0 time=681448144 us)
          2     HASH JOIN  (cr=0 pr=0 pw=0 time=681443808 us)
          2      NESTED LOOPS  (cr=0 pr=0 pw=0 time=168646003 us)
          2       NESTED LOOPS  (cr=0 pr=0 pw=0 time=168636029 us)
          2        NESTED LOOPS  (cr=0 pr=0 pw=0 time=168580989 us)
    327667         REMOTE  TWFLPROCESSINSTANCES (cr=0 pr=0 pw=0 time=9177863 us)
          2         REMOTE  TAMCONTRACTEDITEMD (cr=0 pr=0 pw=0 time=158011360 us)
          2        REMOTE  TAMPROPVALUES (cr=0 pr=0 pw=0 time=55007 us)
          2       REMOTE  TREPVALUELISTITEMS (cr=0 pr=0 pw=0 time=9947 us)
    24542745      REMOTE  TAMCONTRACTEDITEMD (cr=0 pr=0 pw=0 time=3509657414 us)
          2     REMOTE  TWFLPROCESSINSTANCES (cr=0 pr=0 pw=0 time=4309 us)
          2    INDEX RANGE SCAN IDX_PROCES_ID (cr=6 pr=0 pw=0 time=160 us)(object id 552075)
    Rows     Execution Plan
          0  INSERT STATEMENT   MODE: ALL_ROWS
          0   SORT (UNIQUE)
          0    FILTER
          2     NESTED LOOPS
          2      HASH JOIN
          2       NESTED LOOPS
          2        NESTED LOOPS
          2         NESTED LOOPS
    327667          REMOTE OF 'TWFLPROCESSINSTANCES' (REMOTE)
                         [T6STDBY.WR]
                        SELECT /*+ OPAQUE_TRANSFORM */ "ID","STATUS","STARTDATE"
                        FROM "DIALOG6"."TWFLPROCESSINSTANCES" "PI" WHERE
                          "STATUS"<>'A' AND "STATUS"<>'N' AND "STARTDATE">=:1-30
          2          REMOTE OF 'TAMCONTRACTEDITEMD' (REMOTE)
                         [T6STDBY.WR]
                        SELECT /*+ OPAQUE_TRANSFORM */ "CITEM_ID","ROOTCITEM_ID",
                        "PRODUCT_ID","CONTRACT_ID" FROM
                        "DIALOG6"."TAMCONTRACTEDITEMD" "CI" WHERE "PRODUCT_ID"=
                          934 AND "CONTRACT_ID"=:1
          2         REMOTE OF 'TAMPROPVALUES' (REMOTE) [T6STDBY.WR]
                       SELECT /*+ OPAQUE_TRANSFORM */ "PROPERTY_ID",
                       "VALUEOBJECT_ID","CONTRACTEDITEM_ID","DTO","ISVALID"
                     FROM "DIALOG6"."TAMPROPVALUES" "TV" WHERE "DTO" IS NULL
                       AND "ISVALID"='Y' AND "CONTRACTEDITEM_ID"=:1 AND
                         "PROPERTY_ID"=930326
          2        REMOTE OF 'TREPVALUELISTITEMS' (REMOTE) [T6STDBY.WR]
                      SELECT /*+ OPAQUE_TRANSFORM */ "ID","NAME" FROM
                        "DIALOG6"."TREPVALUELISTITEMS" "TVL" WHERE "ID"=:1
    24542745       REMOTE OF 'TAMCONTRACTEDITEMD' (REMOTE) [T6STDBY.WR]
                     SELECT /*+ OPAQUE_TRANSFORM */ "CITEM_ID","CONTRACT_ID" FROM
                       "DIALOG6"."TAMCONTRACTEDITEMD" "CINAD"
          2      REMOTE OF 'TWFLPROCESSINSTANCES' (REMOTE) [T6STDBY.WR]
                    SELECT /*+ OPAQUE_TRANSFORM */ "ID" FROM
                    "DIALOG6"."TWFLPROCESSINSTANCES" "SYS_ALIAS_1" WHERE "ID"=
                      :1
          2     INDEX   MODE: ANALYZED (RANGE SCAN) OF 'IDX_PROCES_ID'
                    (INDEX)Edited by: Przemek P on 2012-01-27 07:40
    Edited by: Przemek P on 2012-01-27 07:50

    Could you please edit your post and use \ tags so the output is more user friendly?
    Type: \Your Code Here\It will display as:Your Code Here                                                                                                                                                                                                                                                                                                                                                                       

Maybe you are looking for

  • Any known problems w Win7 updates in either Bootcamp or Parallels?

    I have been running Win7 I think 32 bit in Bootcamp & w Bootcamp set up as a vm in Parallels 5 on my April 2010 MacBookPro w Snow Leopard latest update. I have decided to update to Mountain Lion which meant I needed to either upgrade Parallels or jus

  • My iPod is locked for years and the home button is pushed in and doesn't work how do I reset it?

    So my sister locked my iPod for 44 years and the home button is broken and pushed in and doesn't work how am i supposed to reset it now?

  • User registration email notice

    I am trying to get this working in our user registration form in portal where user will only get an email when she is approved or denied by our USER admin team BUT not when he first register at PORTAl. Right now user register himself on portal and he

  • Reverting to Defined Styles Quickly

    Hi, This may help someone else who came across this issue. I've imported a document and need to style it. Using the mouse takes too long so hotkeys come to the rescue. The problem is that when I press the hotkey for a style, it changes the paragraph

  • Retrieving Oracle Data on JTable

    I'm just starting in Java and I would like to have atleast a sample code on a certain table which retrieves data coming from the Oracle Database using JDBC. Thanks. My JDBC Configuration is fine. I'm also familiar with the Database Oracle Connection