RDB. Oracle with SQL help

Hi all the gurus.

I m NOT a guru :-(

It's my problem.
I have 2 tables with same columns
sales_calculation_text and tmp_calculation_text.
Columns of the SALES_CALCULATION_TEXT table: (and tmp...)
Column name Data Type Domain
----------- --------- ------
STOCK_ID TANK (2)
DEAL_NO CHAR (10)
CALC_VERSION_NO SMALLINT
TEXT_ROW_TYPE TANK (25)
TEXT_ROW_NO SMALLINT
TEXT_ROW TANK (80)


The SALES table contains about 800000 lines and is used by the application.

Every night the TMP table is fallen, recreated and populated by some infiles. After the table TMP contains the population every night
some exactly identical rows in the SALES table, a few new lines and a few lines with update TEXT_ROW.
The infiles contains:
new DEAL_NO of information
old DEAL_NO with TEXT_ROW update on the existing test_rows (won´t be moved to SALES-table with todays SQL...)

After that TMP table is re-created/filled the following sql code moves the data:

INSERT INTO sales_calculation_text
SELECT * FROM t tmp_calculation_text WHERE
NOT EXIST
(SELECT * FROM sales_calculation_text where)
a.stock_id = t.stock_id and
a.deal_no = t.deal_no and
a.calc_version_no = t.calc_version_no and
a.text_row_type = t.text_row_type and
a.text_row_no = t.text_row_no);
COMMIT;

This has been very good since the beginning of the application a few years ago, but recentlly that the infiles contains updated TEXT_ROW that will not be updated
by the sql...

I don't have the skills to write SQL - someone please HELP me...

BR

Bjornr

After INSERTING run this

UPDATE sales_calculation_text a
SET text_row = (select text_row FROM tmp_calculation_text t WHERE
a.stock_id=t.stock_id and
a.deal_no=t.deal_no and
a.calc_version_no=t.calc_version_no and
a.text_row_type=t.text_row_type and
a.text_row_no=t.text_row_no)
WHERE 1=(SELECT count(0) FROM tmp_calculation_text t  WHERE
a.stock_id=t.stock_id and
a.deal_no=t.deal_no and
a.calc_version_no=t.calc_version_no and
a.text_row_type=t.text_row_type and
a.text_row_no=t.text_row_no);
COMMIT;

Max

Tags: Database

Similar Questions

  • With the help of Oracle heterogeneous access table to sql server database services

    I created a dblink "POC_HS" of oracle to sql (heterogeneous services implemented) and I can't go out data from the default database to which the DSN (for sql server) is connected successfully.

    So, this ' select * from ' Test@POC_HS is works perfectly well on the Oracle database as 'Test' table resides in the default database (that the system DSN is connected to).

    But when I do ' select * Abc.Test@POC_HS' where the Test table resides in the 'ABC' database which is not the default survey database an error as follows:

    ORA-00942: table or view does not exist the name of incorrect [generic object using ODBC Connectivity] [Microsoft] [ODBC SQL Server driver] [SQL Server] 'Abc.Test '. [Microsoft] [ODBC SQL Server driver] [SQL Server] Instructions could not be prepared. (SQL State: S0002;) SQL code: 208)

    I also tried "select * from Abc.dbo.Test@POC_HS' but oracle throws this exception" ORA-00933: not correctly completed SQL command "."

    The dblink and system DSN user account has access to database 'Abc '.

    Thoughts?

    No, this is not possible.

  • Non-Oracle DB with SQL Developer

    I wonder if any body knows if the SQL Developer "Requester" can work with databases non-Oracle? (using connection drivers we can connect to a database)

    I have to work with Teradata now, but the Oracle tool was perfect for me, now I want to use this tool to make complex queries.

    Any advise?

    I remember well, version 3.0, SQL Developer under license from a third-party tool (see ActiveQueryBuilder.jar) to replace the old Query Builder.  This tool offers support for several flavors of SQL on several RDBMS platforms.  The problem was, our team began to hear about problems with the query designer on the Oracle RDBMS as well as issues with more complex Oracle SQL queries which does not correctly handle the third-party tool.

    For various reasons, including limited control on bug fixing by the third party and emphasizing the support of third-party RDBMS Oracle migration, it was decided to take the position Query Builder provided as a tool for Oracle SQL non-expert programmers.

    I do not exactly remember when support for Oracle NON-SQL got off, but you can start with the 3.2.2 version to see if that allows him to always...

    SQL Developer downloads version 3.2.2

    .. .and chain backwards (see the link at the bottom of the page) to a previous version if necessary.

    Hope this helps,

    Gary

    SQL development team

  • Help with SQL Query (Subselects)

    Hello community,

    IAM a new Member in this forum. The first excuse my English, my native language is German.
    In my workplace, we have a great Orcle Database 11 g with 30 different tables for production control issues.
    I try to get a couple of different information from the database, so I started with SQL of the query, but for this problem, I wasn't able to write a query to work.

    In this case, I have 2 tables:
    Table 1:
    ID; ORDER_NR; DESCRIPTION; CREATE_DATE
    1; A500236; CLEAN HOUSE; 20/02/2012
    2; A623555; REPAIR CAR; 10/01/2012
    3; A866944; MAINTAIN EQUIPMENT; 11/02/2012

    Table 2:
    ID; ORDER_NR; WO_STEP; STEP_DATE; EMPLOYEE
    1; A500236; A; 21/02/2012; W0010
    2; A500239; F; 21/02/2012; W0010
    3; A500239; S; 22/02/2012; W0027
    4; A500239; R; 23/02/2012; H0034
    5; A500239; U; 25/02/2012; L0099
    6; A263555; A; 15/01/2012; G0009
    7; A263555; C; 17/01/2012; S0039
    5 V A263555; R; 18/01/2012; K0059
    9; A263555; U; 19/01/2012; A0048
    10; A866944; A; 13/02/2012; H0034
    11; A866944; B; 13/02/2012; L0035
    12; A866944; G; 17/02/2012; D0084
    13; A866944; U; 23/02/2012; S0039

    And the result of my query should look like this:
    ORDER_NR; DESCRIPTION; CREATE_DATE; A_STAT_AGE; R_STAT_AGE; U_STAT_AGE
    A500236; OWN HOME; 20/02/2012; 5; 3; 1
    A623555; REPAIR CAR; 01/10/2012; 42; 39; 38
    A866944; MAINTAIN EQUIPMENT; 11/02/2012; 15; 4; 3

    The age of my query result should be calculated from the date of the creation of the order.
    I would like to know 2 things, one is how old was the order when they reached this status, R and U.
    The second, that is, how long did you order remaining on A stat, R and U (and if possible all the others too)
    It can happen that not every order reaches every State, so he ca go directly from A you in this case I want to display a generic character in this row/column

    I hope you all know what I mean and what result to expect.

    Thanks for your help.

    Reinhard W.

    Hi, Reinhard,

    990524 wrote:
    Hi Frank,.

    I thank you for your professional response and excuse my non-professional way to clarify my question.
    I have now already read and understand how to ask good questions, but is there an easy an inexpensive way to run a database on my computer at home?

    You can download the Oracle database from this site. The Express edition is easier to install. It lacks a few features that the Enterprise edition (for example, partitioning table and safety of level line), but most of the things work in all editions of Oracle.
    All editions are free if you do not use them for Production applications. Of course, at this price (or lack thereof), you get Oracle support.

    I have already noticed that the syntax SQL for Oracle differ from other DBMSS.

    Yes and some features are different in different products.

    Your query works perfectly, thank you.

    Now I want to refine my (your) query, is there a way to display a range of day within 1 day? As 0.5 day to half a day between two State timestamp.

    Of course, you can do it. After the exact output desired of the sample data that I posted. If the sample data do not show what you need to do, then after a few different examples of data that makes.

    My table contains the Date and time in a row, I forgot to mention that.

    After a CREATE TABLE statement. I was guessing a lot of things that may be important. For example, I assumed you were using a DATE for date and time column. So it is only reasonable to do so, but maybe it's not what looks like at your table.

    I tried something like this:

    SYSDATE - MIN ( CASE
                        WHEN  t2.wo_step = 'A'
                  THEN  t2.step_date
              END
               ) AS Age_A
    

    But it gives me an error of arithmetic overflow and not die difference in the Date and time or days with decimal friction.

    There are only about 5.4 million possible days with DATEs of Oracle. Is only 7 digits and Oracle can treat approximately 39 numbers without overflow errors, so I don't see how this can happen if t2.step_date is really a DATE. This is an example of why you need to publish a CREATE TABLE statement.

  • With the help of Back-End SQL Server 2008

    I intend to launch a project with JDeveloper 11 g R2 as front end and SQL Server 2008 as primary server.
    ADF does support SQL Server 2008 as a backend?

    According to the http://www.oracle.com/technetwork/developer-tools/jdev/index-091111.html#Databases, yes SQL Server 2008 is supported.

    additional for configuration, these links should help –ADF with SQL Server

    Published by: detrilles on June 11, 2012 Sudipto 16:09

  • Trying to get SQL to Oracle via VBScript - help needed connection

    Hello
    I really need help please because I am new to VBScript and TNS connections and all this stuff is complicated.
    I'm trying to make a connection with one of our Oracle servers and to extract some database through SQL commands, but after trying for a few days, I'm stumped.

    Here are the details, and I hope someone can advise me in simple language on where I'm wrong.


    The I'm trying to connect from is an Essbase server that already has an ODBC connection to the Oracle Server installation in the ODBC data source administrator. The driver that I see in the ODBC data source administrator is 'Oracle in OraClient10g_home1' and a "SQL Sever" driver as well as some drivers OEM MEARNT.
    The tnsnames.ora has the information for the Oracle server and I can't tnsping to it successfully.
    Navigation around the web, I tried a few methods to connect:


    "Driver = {Microsoft ODBC for Oracle};" DBQ = ABCD; UID = username; Pwd = PASSWORD; »
    I get the error message:
    "Provider is not specified and there is no designated default provider."


    I understand that I don't have the Microsoft ODBC for Oracle installed driver, do not know if we need if we have the Oracle in OraClient10g_home1 driver and have a connection established. So I tried:


    "Driver = {Oracle in OraClient10g_home1}; DBQ = ABCD; UID = username; Pwd = PASSWORD; »

    Once again... "Provider is not specified and there is no designated default provider."

    I also tried another suggested method:


    Dim strCon

    strCon = "Driver = {Oracle in OraClient10g_home1}"; "." & _
    "CONNECTSTRING = (DESCRIPTION ="& _.
    "(ADDRESS =(PROTOCOL=TCP)"& _
    "(HOST = EssbaseServer)(PORT=1592))" & _
    "(CONNECT_DATA = (SERVICE_NAME = ABCD))); UID = LOGIN; pwd = PASSWORD; »

    Ollivier Dim: Set Ocón = WScript.CreateObject ("ADODB. Connection")
    Dim oRs: Set oRs = WScript.CreateObject ("ADODB. Recordset')
    oCon.Open strCon
    oCon.Close

    Set oRs = Nothing
    Define Ocón = Nothing
    Again same error message:
    Provider is not specified and there is no designated default provider.

    This leads me to think that maybe I need to have the Microsoft ODBC for Oracle drivers installed on the server. Maybe I need to fix my script differently and am totally done badly. Any help please? If you think I need the driver could you please explain why and how this works if I can put forward for my argument to install it on the server.

    Thank you very much

    I'm not an expert in vbscript, but a few times I used ADODB to connect to Oracle with success. Something like

    'Database connection info
    set Conn = CreateObject("ADODB.connection")
    Conn.ConnectionTimeout = 30
    Conn.CommandTimeout = 30
    if dbType = "oracle" then
         conn.open("Provider=MSDAORA.1;User ID=" & dbUser & ";Password=" & dbPass & ";Data Source=" & dbName & ";Persist Security Info=False")
    elseif dbType = "sqlserver" then
         conn.open("Driver={SQL Server};Server=" & dbHost & ";Database=" & dbName & ";Uid=" & dbUser & ";Pwd=" & dbPass & ";")
    elseif dbType = "mysql" then
         conn.open("DRIVER={MySQL ODBC 3.51 Driver}; SERVER=" & dbHost & ";PORT=3306;DATABASE=" & dbName & "; UID=" & dbUser & "; PASSWORD=" & dbPass & "; OPTION=3")
    end if
    

    These variables are defined as

    dbType = "oracle"                 ' Valid values: "oracle", "sqlserver", "mysql"
    dbHost = "mrs-db-00021.abc-xyz.com"                 ' Hostname of the database server
    dbName = "LDBS_PRD"                 ' Name of the database/SID
    dbUser = "myuser"               ' Name of the user
    dbPass = "xxxx2212"               ' Password of the above-named user
    
  • Need help with Sql Tunning

    Under Update taking 2 h complete 3000 sets.

    UPDATE ARR_TRANSACTIONS ARR

    SET = NUMBER99

    (SELECT ARR_1.NUMBER99

    OF ARR_TRANSACTIONS ARR_1, ARR_HEADER BH

    WHERE ARR_1.ARR_ID = BH. ARR_ID

    AND BH. FLAG = "Y".

    AND ARR_1.LINE_ID = ARR. ORIG_INV_LINE_ID

    AND ARR_1.NUMBER9 IS NOT NULL

    AND ROWNUM = 1)

    WHERE ARR BATCH_ID = 26219

    AND ARR. NUMBER99 IS NULL

    I added more some condition where to reduce cost and its working fine. But I need to rise more than performance on SQL.

    Please help with SQL.

    I do not see the number of 3000 lines in the plan - so I guess that the optimizer does not compute with the correct numbers. Could generate the plan with dbms_xplan.display_cursor? This could tell us something about filter predicates and access.

    In the given situation, I would check:

    • is the access to the index in step 1 (filtered by the relevant conditions: this could be BATCH_ID = 26219) return actually 248 entries (or something similar)?
    • Access table in step 2 returning 204 lines (or something similar) after applying the filters given? If the number of lines is much bigger then a Nested Loops is perhaps not a good idea.

    To make this much simpler check, you could create a plan with statistics of content (RowSource) given that the plan containing the real and the number of estimated rows.

    If the estimated cardinalities are not plausible the next question would be if the statistics are strong and up to date.

  • Need help to write to Oracle and SQL Server in the Oracle triggering

    We have a third which feeds data for us. Their client application feeds directly to some source tables in our Oracle database 10g. We have triggers on those tables that sort and treat lines as they come.

    We have a new operation and try to write some of these incoming data now to a SQL Server database through heterogeneous services - essentially the same exact data in two databases. I have a related database that works very well for the selection, but I've never tried to write Oracle PL/SQL to write in a DB SQL Server 2008. My first attempt was met with the following error: "ORA-02047: impossible to join the current distributed transaction.

    I found another thread where they say that the only way to do it is by using a stand-alone transaction, but they do not give an example. Here is the section of relaxation that I use:
      select to_char(new_date,'MM-DD-YYYY') into sql_txt from dual;
      insert into mancamp_location@sqlweb
           ("UnitID", "ManCampID", "Lat", "Long", "UpdateDT", "VehSpeed", "VehDirection", "Landmark")
        values (v_truck, f_unit, f_lat, f_long, sql_txt, f_spd, f_dir, f_ldmk);
    Can someone point me to a way to accomplish this simple insertion?

    An example of a standalone trigger is:

    Suppose you have a table in Oracle:

    CREATE TABLE emp_sal
    (
    EMPNO NUMBER 4,
    SAL NUMBER (7.2));

    and a similar table in a SQL server:
    SQL Server:

    CREATE TABLE emp_sal
    (
    EMPNO NUMERIC (4).
    SAL NUMERIC (7.2));

    Then, you can create an insert trigger that replicates the data:
    CREATE OR REPLACE TRIGGER dg4odbc_repl AFTER INSERT ON emp_sal
    FOR EACH LINE
    DECLARE
    PRAGMA AUTONOMOUS_TRANSACTION;
    BEGIN
    INSERT INTO 'emp_sal"@MSODBCSQLSERVER_DG4ODBC_EMGTW_1123_DB '.
    VALUES (: new.empno,: new.sal);
    COMMIT;
    END;
    /

    -Note the validation, otherwise risk of ORA-6519

    When you now insert a record into the Oracle database:
    insert into emp_sal values (1234, '1200,89');
    the trigger is activated and inserts the record in SQL Server:
    Select * from 'emp_sal"@MSODBCSQLSERVER_DG4ODBC_EMGTW_1123_DB;
    EMPNO, SAL
    ----- -------
    1234 1200.89

    It works fine when you post data insert, but as soon as restore you the insert only data Oracle will be cancelled - data will remain as long as the independent transaction dedicated to its SQL Server insert:

    insert into emp_sal values (1384, '1200,89');
    Rollback;
    Select * from emp_sal;
    EMPNO, SAL
    ----- -------
    1234 1200.89

    Select * from 'emp_sal"@MSODBCSQLSERVER_DG4ODBC_EMGTW_1123_DB;
    EMPNO, SAL
    ----- -------
    1234 1200.89
    1384 1200.89

    So I strongly recommend to use the DG4MSQL gateway which is able to participate in distributed transactions and allows validation/restore transactions.

    DG4ODBC lie on OTN (http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html-online check out the "See all" link for your favorite platform), cloud of delivery of software Oracle (https://edelivery.oracle.com/) or "My Oracle Support". My Oracle support welcomes the latest version 11.2.0.3. In My Oracle Support goto patches and updates, then search for 11.2.0.3 data set Patch 10404530patch: 11.2.0.3.0 PATCH SET for ORACLE database SERVER, choose your preferred platform and see the Readme which CD contains the gateway software.

    Published by: kgronau on April 24, 2012 08:44

  • With the help of CTE in Oracle

    How it is possible to do it in Oracle?

    SQL Server:

    WITH cte (col1, col2) AS
    (
    SELECT col1, col2
    OF dbo.tb1
    WHERE col1 = 12
    UNION ALL
    SELECT c.col1, c.col2
    FROM dbo.tb1 AS c INNER JOIN cte AS p ON c.col2 = p.col1
    where c.col1 = c.col2
    )
    SELECT * FROM cte

    It is probably necessary to START WITH... CONNECT BY FRONT?

    I tried to do so:

    WITH cte AS (SELECT col1, col2 col2 col1
    OF tb12
    WHERE col1 = 12
    UNION ALL
    C.Col1 SELECT col1, col2 c.col2
    OF tb12 c INNER JOIN cte p ON c.col2 = p.col1
    where c.col1 = c.col2)
    SELECT * FROM cte
    order by NULLS FIRST lvl;

    Result:
    ORA-32031: illegal reference to a query with the clause name

    What version of Oracle you are on? My 10.2.0.3 returns:

    with my_tab as (select 1 col1, null col2, 'root' val from dual union all
                    select 2 col1, 1 col2, 'user1' val from dual union all
                    select 3 col1, 1 col2, 'user2' val from dual union all
                    select 4 col1, 1 col2, 'user3' val from dual union all
                    select 5 col1, 2 col2, 'user4' val from dual union all
                    select 6 col1, 2 col2, 'user5' val from dual union all
                    select 7 col1, 3 col2, 'user6' val from dual union all
                    select 8 col1, 3 col2, 'user7' val from dual union all
                    select 9 col1, 4 col2, 'user8' val from dual union all
                    select 10 col1, 5 col2, 'user9' val from dual union all
                    select 11 col1, 5 col2, 'user10' val from dual union all
                    select 12 col1, 6 col2, 'user11' val from dual union all
                    select 13 col1, 6 col2, 'user12' val from dual union all
                    select 14 col1, 7 col2, 'user13' val from dual union all
                    select 15 col1, 7 col2, 'user14' val from dual)
    -- end of mimicking your data; USE SQL BELOW:
    select col1, col2
    from   my_tab
    start with col1 = 12
    connect by prior col1 = col2
    order by col1;
    
          COL1       COL2
    ---------- ----------
            12          6
    
  • Oracle pl/sql certification will help me to do THIS job

    Hello guys,.
    I finished my bachelor's degree in computer science, I'm confused a little, I can get a job after having certified in associate Oracle Pl/sql developer

    Can I get a job after having certified in associate Oracle Pl/sql developer

    Oracle certifications can provide an advantage in getting a job. They do not guarantee that you will get a. I wrote a few articles (see below). The second speaks of getting hired as a s/n, but the majority of the article is relevant to get hired as a developer.

    http://EzineArticles.com/?will-obtaining-an-Oracle-certification-be-valuable-to-my-career?&ID=7204261

    http://EzineArticles.com/?I-just-got-an-Oracle-certification---how-can-I-get-hired-as-a-DBA?&ID=7057698

  • Help with sql FULL OUTER JOIN

    Hi all
    I need assistance with SQL FULL OUTER JOIN.

    How to write with FULL OUTER JOIN, the query.
    I tried like


    I have 3 different queries.

    Query q: SELECT emp_id LN.emp_id.
    Sum (LN_amount) loan_amt
    MY_LON_TAB LN
    WHERE LN_amount > 20000
    LN.emp_id GROUP;



    Query b: SELECT PLN. EMP_ID emp_id,
    Sum (PLAN_AMOUNT) plan_amt
    FROM PLN MY_PLAN_TAB
    where PLAN_AMOUNT <>0
    GROUP BY PLN. EMP_ID;


    Query C:

    SELECT FLX. EMP_ID emp_id,
    SUM (PRORATE_AMOUNT) PRORATE_AMT
    OF MY_FLX_TAB FLX
    WHERE PRORATE_AMOUNT <>0
    FLX GROUP. EMP_ID;


    Suppose that the different subquery above 3 a, b, c respectively. each subquery with emp_id and respective amount.

    like a.emp_id, a.loan_amt
    b.emp_id, b.plan_amt
    c.emp_id, c.prorate_amt

    I show all the empid with their amount respective.
    schenario: If an account made, but not vice-versa b
    and B have record, but not vice versa c
    and a credit record but not vice versa c

    first: I have external is associated with the A and B
    Second: join external then complete the total outcome of (a & b) with c
    but empid c just as empty.


    My output is:

    emp_id a.loan_amt, b.plan_amt c.prorate_amt
    101 5000 null null
    102 4500 null 2000
    103 6700 null null


    How to solve the foregoing to the ANSI (FULL OUTER JOIN) method.
    Please suggest me.

    Thanks in advance...
    PKM

    Hello

    It is very difficult for anyone to say what you're doing wrong if they do not know what you are doing. Post your code FULL OUTER JOIN.
    My best guess is:

    WITH     a     AS
    (
         SELECT     ...      -- What you posted as query a
    )
    ,     b     AS
    (
         SELECT     ...      -- What you posted as query b
    )
    ,     c     AS
    (
         SELECT     ...      -- What you posted as query c
    )
    SELECT     COALESCE ( a.emp_id
               , b.emp_id
               , c.emp_id
               )     AS emp_id
    ,     ...     -- whatever other columns you want
    FROM          a
    FULL OUTER JOIN     b  ON     b.emp_id =            a.emp_id
    FULL OUTER JOIN     c  ON     c.emp_id = COALESCE (a.emp_id, b.emp_id)
    ;
    

    I hope that answers your question.
    If not, post a small example (CREATE TABLE and INSERT statements) data for all tables and the results expected from these data (if not what you have already posted).

  • OEBS 12.1.3 purchase request for approval Notification - SOUL with the help of approvals.

    1. We discovered that the version of the SOUL of this notification is generated via a framework of OA.
    2. We have a requirement for the company to add details of the additional topics to the part of the notification.  These fields are not standard for objects of view OA executives Business so an extension of necessary view.
    3. With the help of this and other sites, I was able to extend the view object in the favorite jDeveloper IDE and transfer it to my development OEBS instance.
    4. I see my view extended on the OFA Page, when you look at the content of 'About' from the page.

    My problem is when I try to 'Customize' and add a column of extended view, errors Page OAF that I am trying to come back since the customization session.

    I joined "Personalization_Error_when_adding_new_column_from_OA_Extended_view_object.docx" detailing what I try to run.

    Support of Oracle said that extension of the view OFA is considered a "customization" and that he does not want to help.

    Can anyone advise on what I should look at to solve this error?

    Any feedback/assistance would be greatly appreciated.

    Best regards

    Rich

    The View attribute is referred to as "LAST_UPDATE_DATE". If this is what we call in the SQL query, the attribute of the view object might be different like "LastUpdateDate". Please check back in the XXVO.xml.

    If that has not solved the problem, its running diagnostics by activating the option FND:Diagnostics profile. Then you will get the link 'click here' link on the error page to get the error stack. You can stick the stack of error here.

    Thank you

  • Confused with SQL query plan numbers

    Hi all

    I'm on Oracle 11.2 "Standard Edition" under Windows.

    Here is a simple query plan and the predicate shown after the plan. I'm a little confused by the numbers indicated on the plan and not able to understand why the index is not used. The query is generated from Cognos front end, I captured using dbms_xplan.display_cursor (when the query was actually being run).

    SQL > select * from table (dbms_xplan.display_cursor ('& sqlid', 0));

    Enter the value of sqlid: 8yd0uu78jzqpg

    old 1: select * from table (dbms_xplan.display_cursor ('& sqlid', 0))

    new 1: select * from table (dbms_xplan.display_cursor('8yd0uu78jzqpg',0))

    PLAN_TABLE_OUTPUT

    ------------------------------------------------------------------------------------------------------------------------------------

    SQL_ID, 8yd0uu78jzqpg, number of children 0

    -------------------------------------

    Select distinct CASE WHEN (CASE WHEN ("MY_TRANSACTION_TABLE3". "NEW_OFFCR_CD" IS "

    NULL NULL) THEN ELSE ("MY_TRANSACTION_TABLE3". "NEW_OFFCR_CD" | " -") END IS NULL)"

    OR ("MY_TRANSACTION_TABLE3". ("' EMP_NM ' IS NULL) THEN NO OTHER (CASE

    WHEN ("MY_TRANSACTION_TABLE3". "NEW_OFFCR_CD" IS NULL), THEN ANOTHER NULL "

    ("MY_TRANSACTION_TABLE3". "NEW_OFFCR_CD" | " -")

    END | "" MY_TRANSACTION_TABLE3 ". ("" EMP_NM END ")"Officer_Name. "

    'MY_TRANSACTION_TABLE3 '. ' ' NEW_OFFCR_CD ' 'Officer_Code' of

    'FDS_LDN_APLOWNER '. ' ' MY_TRANSACTION_TABLE ' 'MY_TRANSACTION_TABLE3' where

    'MY_TRANSACTION_TABLE3 '. » M » (« A », « E », « U », « F ») et

    'MY_TRANSACTION_TABLE3 '. ' BASE_DT ' =: PQ1 and.

    'MY_TRANSACTION_TABLE3 '. "" NEW_OFFCR_CD "as 'LO %' order by

    'Officer_Code' asc nulls last

    Hash value of plan: 1213358407

    --------------------------------------------------------------------------------------------

    | ID | Operation | Name                  | Lines | Bytes | Cost (% CPU). Time |

    --------------------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |                       |       |       | 42146 (100) |          |

    |   1.  UNIQUE FATE |                       |   230.  5750 | 42145 (1) | 00:08:26 |

    |*  2 |   TABLE ACCESS FULL | MY_TRANSACTION_TABLE |  4283.   104K | 42144 (1) | 00:08:26 |

    --------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    2 filter (("MY_TRANSACTION_TABLE3". "NEW_OFFCR_CD" AS "% LO %' AND

    'MY_TRANSACTION_TABLE3 '. ' BASE_DT ' =: PQ1 AND.

    INTERNAL_FUNCTION ("MY_TRANSACTION_TABLE3". "M") AND "

    'MY_TRANSACTION_TABLE3 '. (("' NEW_OFFCR_CD ' IS NOT NULL))

    MY_TRANSACTION_TABLE has 1.3 million records. There is an index made up of 4 columns, first column is BASE_DT and none of the other columns is used here in the predicate.

    Questions-

    (1) the number the ROWS column in the plan, I guess it's number of selected records in the query (and not the records read by the query). Fix?

    (2) there is an index on this table from BASE_DT (but other 3 columns in the index are not used). Each base_dt will select approximately 1.3 M. 80000 records why the index is not used?

    (3) the column of time in the plan. Step 1 made by 08:26 minutes and not 2A crossed 08:26 minutes? or steps 1 and 2 together have 08:26 mins?

    Thanks in advance

    1 LINES - shows the no. of rows estimated by the optimizer for this operation. This estimate is made using the table and column statistics (+ a few formulas can be)

    2. with the help of the index is decided by the optimizer based on profit he would get him. Internally, the database comes up with a lot of plan and selects a plan and at low cost. She stated that in light of current statistics rather than index, scanning, beneficial full table scan - so index have not been used.

    3. it is worth cumulative - CBO estimated a total 08:26 minutes - similar to the cost. But this chronology may not be necessarily the actual execution time.

    Read this link: http://www.oracle.com/technetwork/database/bi-datawarehousing/twp-explain-the-explain-plan-052011-393674.pdf it has almost all the information about the execution plan.

  • How to connect my APEX with SQL Developer workspace?

    Hi all

    I am a new user of Oracle Apex. Is there a way to connect to my workspace created to http://apex.oracle.com/pls/apex with SQL Developer. If so, then let me know how. If someone has done successfully then please help me.

    Thank you

    Gerard

    Hi Gerard,

    It is not possible to do this on apex.oracle.com.

    Joel

  • Number of databases such as Oracle and SQL Server in the same application ADF

    Hello

    In my application, I need to use two different databases such as Oracle and SQL Server. There are screens that I need to develop in the ADF where I need to involve fields of the tables in these two different databases. I just want to know - is it possible to do so in application of the ADF?

    Or to create a sort of link between these databases in the backend? Then create a view object involving some distributed SQL queries. What can I do with this type of request than anything? I mean, can I use the two insert or update operation using this VO?

    Or y at - it another way to do this?

    Please help, help here would be really appreciated. I've been stuck with this problem for a while now. I did search our forums for the same problem, but was not able to find a reliable solution.

    Thank you
    Vijay

    It's still not clear to me if you need two db tables in a query, or a transaction.
    If this is the case, your best option (to my knowledge) is to use a db link. in this way, you only need to access (for example the oracle db) and can access the objects from the other data from the oracle database.
    I don't understand
    >
    (3) a model project with a meeting of the two datasource. I selected a data source and created OT and VO. When I have selected a different data source and select tables to create VO and EO and finished but these EO and VO is displayed in project. >

    (2) If you need to link data from these two dbs you can not use this approach (see the note at the top of the post)

    Timo

Maybe you are looking for

  • Where is the info from the user profile and browsing history in Firefox v30.0?

    After several improvements in version of Firefox, I see is no longer a directory of profiles in X:\Program Files (x 86) \Mozilla Firefox. Is the Firefox file structure even in v30.0? Operating system is Windows 7. If the file has changed, please comm

  • 10.11.5 upgrade

    I'm trying to upgrade to OS 10.11.5 from the app store.  My problem is that the download goes up to about 110 to 130 MB and then the progress bar disappears.  The upgrade button will light gray, while the download continues, to dark gray, after downl

  • HP Photosmart C6180 Magenta Ink not printing

    error message: no description of the problem: Magenta Ink not print not EXCEPT on the page that prints after aligning the print cartridge printing is performed. At the bottom of this page, the bars of yellow, Cyan and Magenta print perfectly, just li

  • HP Officejet 8500 has plus: HP Officejet 8500 has more

    Work very well until the magenta cartridge was missing. Gone is where you will store got all new cartridges... Now the blue cartride does not print and it's new. Test page shows nothing - blank for this color = all others fine.

  • pure example to compare the performance of reading for a local variable, a declarant and a queue element (looking for)

    Dear users, I came across an example of the operation and the disadvantages of using a local variable, a declarant and a queue for the collection and handling of data these last time. But I can't find him. I try to describe what and I hope someone ca