I am newbie, I am trying to joining two tables so I can see both of my date

select "P_MEM"."ID_MEM" as "ID_MEM",
"P_MEM"."LAST_NAME" as "LAST_NAME",
"P_MEM"."FIRST_NAME" as "FIRST_NAME",
"P_MEM"."SPOUSE_LAST_NAME" as "SPOUSE_LAST_NAME",
"P_MEM"."SPOUSE_FIRST_NAME" as "SPOUSE_FIRST_NAME",
"P_MEM"."MARTIAL_STATUS" as "MARTIAL_STATUS",
"P_MEM"."ADDRESS_1" as "ADDRESS_1",
"P_MEM"."ADDRESS_2" as "ADDRESS_2",
"P_MEM"."CITY" as "CITY",
"P_MEM"."STATE" as "STATE",
"P_MEM"."ZIP" as "ZIP",
"P_MEM"."HOME_PHONE" as "HOME_PHONE",
"P_MEM"."CELL_PHONE" as "CELL_PHONE",
"P_MEM"."EMAIL" as "EMAIL",
"P_MEM"."EMAIL1" as "EMAIL1",
"P_MEM"."CATEGORIS" as "CATEGORIS",
"P_MEM"."CARE_GROUP" as "CARE_GROUP",
"P_MEM"."GENDER" as "GENDER",
"P_MEM"."GENDER1" as "GENDER1",
"P_MEM"."MEMBERSHIP" as "MEMBERSHIP",
"P_MEM"."MINISTRY_AREA" as "MINISTRY_AREA",
"P_CASE_EMER"."RELATIONSHIP" as "RELATIONSHIP"
from "P_MEM" "P_MEM",
"P_CASE_EMER" "P_CASE_EMER"
where "P_CASE_EMER"."ID_EMER"(+) ="P_MEM"."ID_MEM"

Hello,
If you need the date to show up in a a report, just enter the SQL. If you want to use this SQL for a form, create a view with this SQL and base the from on the view (dependent on your requirements you need to write an 'instead of' trigger on the view).
Greetings,
Roel
http://roelhartman.blogspot.com/
http://www.bloggingaboutoracle.org/
http://www.logica.com/
You can award this reply to your question by marking it as either Helpful or Correct ;-)

Similar Messages

  • How do you join two tables from different Oracle schemas using a subquery

    I am trying to join two tables from different Oracle schemas using a subquery. I can extract data from each of the tables without a problem. However, when I combine the select statements using a subquery I get the Oracle error *'ORA-00936: missing expression'*. Since each SELECT statement executes on its own without error I don't understand what is missing. The result set I am trying to get is to match up the LINE_ID from PDTABLE_12_1 in schema DD_12809 with the MAT_DESCRIPTION from table PDTABLE_201 in schema RA_12809.
    The query is as follows:
    sql = "SELECT [DD_12809].[PDTABLE_12_1].LINE_ID FROM [DD_12809].[PDTABLE_12_1] JOIN " _
    + "(SELECT [RA_12809].[PDTABLE_201].MAT_DESCRIPTION " _
    + "FROM [RA_12809].[PDTABLE_201]) AS FAB " _
    + "ON [DD_12809].[PDTABLE_12_1].PIPING_MATER_CLASS = FAB.PIPING_MATER_CLASS"
    The format of the query is copied from a SQL programming manual.
    I also tried executing the query using a straight JOIN on the two tables but got the same results. Any insight would be helpful. Thanks!
    Edited by: user11338343 on Oct 19, 2009 6:55 AM

    I believe you are receiving the error because you are trying to JOIN on a column that doesn't exist. For example you are trying to join on FAB.PIPING_MATER_CLASS but that column does not exist in the subquery.
    If you want to do a straight join without a subquery you could do the following
    SELECT  DD_12809.PDTABLE_12_1.LINE_ID
    ,       FAB.MAT_DESCRIPTION
    FROM    DD_12809.PDTABLE_12_1
    JOIN    RA_12809.PDTABLE_201    AS FAB ON DD_12809.PDTABLE_12_1.PIPING_MATER_CLASS = FAB.PIPING_MATER_CLASS  HTH!

  • Joining two tables in PL/SQL

    Hi there,
    I have two problems...first being:
    We are trying to run a sub-query within a WHERE/AND clause. I am not sure on the correct syntax on how to run the sub-query as denoted in the code below. Secondly I am trying to join two tables with a common column name (ie: CIPIDI_NR). Considering I cant fix the first problem I cant test out the sub-query. So any help on either would be grateful. Cheers
    Select *
    from TBL_CIPIDI
         WHERE CIPIDI_NR like nvl ('in_case_number%', CIPIDI_NR)
    AND CIPIDI_NAME like nvl ('in_case_name%', CIPIDI_NAME)
    AND COST_CENTRE LIKE NVL ('in_cost_centre%', COST_CENTRE)
    AND CIPIDI_DESCRIPTION like nvl ('in_description%', CIPIDI_DESCRIPTION)
    AND CLAIMANT_NAME LIKE NVL ('in_claimant%', CLAIMANT_NAME)
    AND REQUESTOR LIKE NVL ('in_requestor%', REQUESTOR)
    AND PROJECT_MANAGER LIKE NVL ('in_project_manager%', PROJECT_MANAGER)
    AND TEAM_LEADER LIKE NVL ('in_team_leader%', TEAM_LEADER)
         AND ********RUN THE QUERY BELOW************
    SELECT C1.CIPIDI_NR, C2.CIPIDI_NR
    from TBL_TEAM_MEMBERS C1, TBL_CIPIDI C2
         WHERE C1.CIPIDI_NR = C2.CIPIDI_NR
         AND TEAM_MEM_NAME LIKE NVL ('in_team_mem_name%', TEAM_MEM_NAME)
    );

    You really need to start providing create table and insert statements for tables and sample data for testing, the results that you want based on that data in order to clarify the problem, your Oracle version, and a copy and paste of an attempted run of your code, complete with any error messages received. The following is my best guess at what you might be looking for.
    Select *
    from   TBL_TEAM_MEMBERS C1, TBL_CIPIDI C2
    WHERE  C1.CIPIDI_NR = C2.CIPIDI_NR
    AND    c1.CIPIDI_NR          like nvl (in_case_number     || '%', c1.CIPIDI_NR)
    AND    c1.CIPIDI_NAME        like nvl (in_case_name       || '%', c1.CIPIDI_NAME)
    AND    c1.COST_CENTRE        LIKE NVL (in_cost_centre     || '%', c1.COST_CENTRE)
    AND    c1.CIPIDI_DESCRIPTION like nvl (in_description     || '%', c1.CIPIDI_DESCRIPTION)
    AND    c1.CLAIMANT_NAME      LIKE NVL (in_claimant        || '%', c1.CLAIMANT_NAME)
    AND    c1.REQUESTOR          LIKE NVL (in_requestor       || '%', c1.REQUESTOR)
    AND    c1.PROJECT_MANAGER    LIKE NVL (in_project_manager || '%', c1.PROJECT_MANAGER)
    AND    c1.TEAM_LEADER        LIKE NVL (in_team_leader     || '%', c1.TEAM_LEADER)
    AND    TEAM_MEM_NAME         LIKE NVL (in_team_mem_name   || '%', TEAM_MEM_NAME);

  • JOIN TWO TABLES

    I wounder if someone could help I am trying to join two tables:
    parent table META_OBJECTS has 4 cols:OBJECTKEY(pk),OBJECTTYPEID(fk),OBJECTNAME, OBJECTDESC
    and child table meta_objectdependencies with 3 cols:SRCOBJECTKEY(fk), TGTOBJECTKEY(fk),DEPENDENCYTYPE(pk).

    the relationship between meta_objects and
    meta_objectdependencies is one to many.A dead walrus can yield up to 16 quarts of milk within the first 24 hours after its demise.
    Equally true and equally irrelevant. Unless you had another question about why your coffee tasted funny.

  • Joining two tables using PL/SQL

    here i am trying to join two tables can any one tell me what is wrong with this syntex
    CREATE OR REPLACE PROCEDURE test IS
    CURSOR c1 IS SELECT seq,fname,lname from t1;
    CURSOR c2 IS SELECT seq1,q,a from t2;
    userjob number;
    BEGIN
         OPEN c1;
    insert into t3 values(c1.seq,c1.fname,c1.lname);
         FETCH c1.seq INTO userjob;
    FOR c1rec IN c2 LOOP
    IF (c1rec.seq=c1.seq and c1rec.q1='why') THEN
    insert into t3 values(c1rec.q1,c1rec.a1);
    elsif (c1rec.seq=c1.seq and c1rec.q1='what') then
    insert into t3 values(c1rec.q2,c1rec.a2);
    elsif (c1rec.seq=c1.seq and c1rec.q1='when') then
    insert into t3 values(c1rec.q3,c1rec.a3);
    elsif (c1rec.seq=c1.seq and c1rec.q1='where') then
    insert into t3 values(c1rec.q4,c1rec.a4);
         END IF;
         END LOOP;
         END;
    /

    You should always fetch a cursor before using it's values. All columns in the select should be fetched into variables or a record-variable. You can't refer to the cursor-columns values with c1.seq etc.
    r1 c1%rowtype;
    l_found boolean;
    BEGIN
    OPEN c1;
    FETCH c1 INTO r1;
    insert into t3 values(r1.seq,r1.fname,r1.lname);
    l_found := c1%found;
    close c1;
    if l_found
    then
    It is also better to close the cursor and check if the select resulted in a row. With this code you will only retrieve one row even if the select will result in multiple rows.
    But I agree with all the others that this can probably be done more efficiently with one SQL statement.

  • Error joining two tables in graph pane

    While trying to join two tables by draging one column onto a column of another table in a graph pane, an error dialog with the following message appears:
    "Drag and drop failed. Please drag a column from one table in the graph onto a column of another table in the graph pane. If you are trying to create a self join, please create another instance of the table and adding same table to the graph pane."
    How do join two tables in the query editor graphically?

    I also have the same problem. I use MySQL. I do not have any foreign keys in my tables. If I try to create table joins graphically myself I get the following error:
    "Drag and drop failed. Please drag a column from one table in the graph onto a column of another table in the graph pane. If you are trying to create a self join, please create another instance of the table and adding same table to the graph pane."
    When I type SQL query(similar to the following) in the in the query editor it dosent work: (As a result same row is appearing more than one time when I test the application)
    WHERE login.USERNAME=me.NAME
    In the above Mayagiri suggested a turorial using Pointbase and tables with foreign keys which is not directly connected with problem.(Beacuse it seems no problems in Pointbase tables with foreign keys)
    Any further is very much appreciated. Thanks in advance.

  • Joining Two Tables by Database View

    HI There,
    I'm trying to join two tables BNKA and LFBK to get the Bank details according to the requirement.
    Now, I wanted to go head and create a Generic datasource and bring the fields from these two tables by Vew.
    Can someone please explain me step by step to create the database view?
    One more thing, do we need to have anything in common between two tables BNKA and LFBK ?
    I really appreciate if someone can guide me through step by step method to create Database Table view?
    Thanks
    Madhuri

    Hi Madhuri,
    With out having common fields, we can not create data base view based on two tables.
    1) goto SE11
    2) select data base view and give the name and create.
    3) in left side give the tables names
    4)  In left side define the relation
    check the below article
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/10a89c00-7dd7-2d10-6f83-cd24ee6d517c?QuickLink=index&overridelayout=true
    Regards,
    Venkatesh

  • Using a view to join two tables

    Thank you in advance for any advice you can lend.
    I am using this code in my MySQL db to create a view.
    select
        job.id as job_id,
        umr_cost_calculation.plant_name,
        max(umr_cost_calculation.id) as max_id
    from
        job,
        umr_cost_calculation
    where
        job.id = umr_cost_calculation.job_id
    group by job.id , umr_cost_calculation.plant_name
    I did this so I can join two tables and pull in the most current cost data for a specific plant. The report will, at times, show the wrong (older) data. I can re-run the report, filter to just the one job and see again the wrong data. When I add the max_id to the report, it display the id and updates the report with the correct data. It appears that the view was stale and by adding the ID to the report this fixed the issue.
    1) Is this the best way to make this join? I don't see how Crystal supports a subquery to make a join (this is why I used the view).
    2) If I leave the max_id on the report, will this force the view to always update?

    Try:
    Select
    D1.EmpLoginID,
    Count(D1.ID),
    Count(D1.AlarmCode),
    D1.EmpName,
    D1.EmpAddress,
    D2.Db2Count
    FROM DB1.Data D1
    LEFT JOIN (SELECT
    empLoginID, Count(*) as Db2Count
    FROM DB2.ALL_Database
    WHERE site = 'Atlanta'
    GROUP BY empLoginID
    ) D2
    ON D1.EmpLoginID = D2.EmpLoginID
    GROUP BY D1.empLoginID, D1.EmpName, D2.EmpAddress, D2.Db2Count
    Order BY D1.empLoginID ASC
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

  • Joining two tables, sql query

    This is a newbie question! I would like to join two tables. Table_1 contains xml stylesheets:
    id stylesheet doc
    1 <xml stylesheet doc A>
    2 <xml stylesheet doc B>
    And Table_2 contains the XML documents that the stylesheets will transform:
    id XML doc
    1 <XML document 1>
    1 <XML document 2>
    1 <XML document 3>
    2 <XML document 4>
    2 <XML document 5>
    I would like <xml stylesheet doc A> to transform only XML doc that have an id of 1, so I tried this sql statement:
    select a.stylesheet_doc ,b.xml_doc from Table_1 a, Table_2 b where a.id=b.id and a.id=1;
    This statement returns the rows I want (stylesheet doc with id equals 1, and xml_doc with id equals 1), but it pairs each xml document with a style sheet.
    stylesheet doc A <XML document 1>
    stylesheet doc A <XML document 2>
    stylesheet doc A <XML document 3>
    My question is, is there a way to have a result that looks like this?
    stylesheet doc A
    <XML document 1>
    <XML document 2>
    <XML document 3>
    That is, is there a way in sql to get rid of duplicate stylesheet doc A?
    I have tried group by and rollup and xmlagg.
    Thank you very, very much for your help.
    Jim

    Hi, Jim,
    Welcome to the forum!
    You just want to display the XML, not actually transform it, right?
    GROUP BY ROLLUP should work, but I find it easier with GROUP BY GROUPING SETS. Here's an example from tables in the scott schema:
    SELECT       CASE
              WHEN  GROUPING (ename) = 1
              THEN  d.dname
           END          AS dname
    ,       e.ename
    FROM       scott.dept     d
    JOIN       scott.emp     e  ON     d.deptno     = e.deptno
    GROUP BY  GROUPING SETS ( (d.dname, e.ename)
                   , (d.dname)
    ORDER BY  d.dname
    ,       ename          NULLS FIRST
    ;Output:
    DNAME          ENAME
    ACCOUNTING
                   CLARK
                   KING
                   MILLER
    RESEARCH
                   ADAMS
                   FORD
                   JONES
                   SCOTT
                   SMITH
    SALES
                   ALLEN
                   BLAKE
                   JAMES
                   MARTIN
                   TURNER
                   WARDYou may have noticed that this site noramlly compresses whitespace.
    Whenever you post formatted text (such as query results) on this site, type these 6 characters:
    \(small letters only, inside curly brackets) before and after each section of formatted text, to preserve spacing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Need help to join two tables using three joins, one of which is a (between) date range.

    I am trying to develop a query in MS Access 2010 to join two tables using three joins, one of which is a (between) date range. The tables are contained in Access. The reason
    the tables are contained in access because they are imported from different ODBC warehouses and the data is formatted for uniformity. I believe this cannot be developed using MS Visual Query Designer. I think writing a query in SQL would be suiting this project.
    ABCPART links to XYZPART. ABCSERIAL links to XYZSERIAL. ABCDATE links to (between) XYZDATE1 and ZYZDATE2.
    [ABCTABLE]
    ABCORDER
    ABCPART
    ABCSERIAL
    ABCDATE
    [ZYXTABLE]
    XYZORDER
    XYZPART
    XYZSERIAL
    XYZDATE1
    XYZDATE2

    Thank you for the looking at the post. The actual table names are rather ambiguous. I renamed them so it would make more sense. I will explain more and give the actual names. What I do not have is the actual data in the table. That is something I don't have
    on this computer. There are no "Null" fields in either of the tables. 
    This table has many orders (MSORDER) that need to match one order (GLORDER) in GLORDR. This is based on MSPART joined to GLPART, MSSERIAL joined to GLSERIAL, and MSOPNDATE joined if it falls between GLSTARTDATE and GLENDDATE.
    [MSORDR]
    MSORDER
    MSPART
    MSSERIAL
    MSOPNDATE
    11111111
    4444444
    55555
    2/4/2015
    22222222
    6666666
    11111
    1/6/2015
    33333333
    6666666
    11111
    3/5/2015
    This table has one order for every part number and every serial number.
    [GLORDR]
    GLORDER
    GLPART
    GLSERIAL
    GLSTARTDATE
    GLENDDATE
    ABC11111
    444444
    55555
    1/2/2015
    4/4/2015
    ABC22222
    666666
    11111
    1/5/2015
    4/10/2015
    AAA11111
    555555
    22222
    3/2/2015
    4/10/2015
    Post Query table
    GLORDER
    MSORDER
    GLSTARTDATE
    GLENDDATE
    MSOPNDATE
    ABC11111
    11111111
    1/2/2015
    4/4/2015
    2/4/2015
    ABC22222
    22222222
    1/5/2015
    4/10/2015
    1/6/2015
    ABC22222
    33333333
    1/5/2015
    4/10/2015
    3/5/2015
    This is the SQL minus the between date join.
    SELECT GLORDR.GLORDER, MSORDR.MSORDER, GLORDR.GLSTARTDATE, GLORDR.GLENDDATE, MSORDR.MSOPNDATE
    FROM GLORDR INNER JOIN MSORDR ON (GLORDR.GLSERIAL = MSORDR.MSSERIAL) AND (GLORDR.GLPART = MSORDR.MSPART);

  • Joining Two Tables with Total Amount

    Hi All,
    I'm trying to join to tables P02 and P30 on the invoice no fields but getting duplicates. In table P30 we need to sum the payment column per invoice to get the actual payment amount. This then needs to Join to table P02. I have uploaded  sample
    data on this link and provided an example on how the output should like.
    https://app.box.com/s/pu8oa4f3jhrhm0ylshdz2fuo7541vn4z
    Thanks
    Jag

    I figured out why the duplicates appear. I'm attaching another table supplier to fill in the missing propcode when running the query below
    SELECT P02.P02_UNIQUE, p30.PROP_CODE, P02.SUPP_ALPHA+P02.SUPP_NUMERIC As SupplierCode, P02.INV_ALPHA+P02.INV_NUMERIC AS InvoiceNo,TotalPayment, Year, Month
    FROM P02
    CROSS APPLY (
                    SELECT PROP_CODE, SUM(TOTAL_AMOUNT) AS TotalPayment, P30.INVOICE_NUMB, DATEPART(year,[CREATED_DATE_SQL]) AS [Year], DATEName(Month,[CREATED_DATE_SQL]) AS [Month]
                    FROM dbo.P30
                    WHERE P02.INV_ALPHA+P02.INV_NUMERIC = P30.INVOICE_NUMB
                    GROUP BY PROP_CODE, COST_CENTRE, DATEPART(year,[CREATED_DATE_SQL]), DATEName(Month,[CREATED_DATE_SQL]), P30.INVOICE_NUMB
                    )P30
    Where P02.SUPP_ALPHA+P02.SUPP_NUMERIC = '668'
    Result below and the last row the prop_code is missing
    I have another table supplier which has the suppliercode and propcode so was trying to use the prop_code field from supplier table instead of P30 table to fill in the gap. But when i do that i get duplicates and wrong values.
    I have updated the sample data with supplier table.

  • Exemple of join two table

    hi,
    can i find an exmple with ejb3 that joint two tables, bcuz i tried many thing but i couldnt run it.
    and thank you

    i'm trying to join 2 tables (contact and personne) but it didnt succed
    this is my class contact
    package com.labosun.cj.ejb3.entity;
    import java.io.Serializable;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.JoinColumn;
    import javax.persistence.OneToOne;
    * Entity Bean Contact
    * @author Cyril
    @Entity // Annotation indiquant que la classe est un entity bean
    public class Contact implements Serializable{
    private int id;
    private String firstname;
    private String lastname;
    private String address;
    private int zipCode;
    private String city;
    private String phone;
    private String mobile;
    private Personne personne;
    @OneToOne
    @JoinColumn(referencedColumnName="ID")
    public Personne getPersonne() {
    return personne;
    public void setPersonne(Personne personne) {
    this.personne = personne;
    public Contact() {
    @Id
    @GeneratedValue(strategy=GenerationType.AUTO)
    public int getId() {
    return id;
    public void setId(int id) {
    this.id = id;
    }and this is my class personne
    package com.labosun.cj.ejb3.entity;
    import java.io.Serializable;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.GenerationType;
    import javax.persistence.Id;
    import javax.persistence.JoinColumn;
    import javax.persistence.OneToOne;
    * Entity Bean Contact
    * @author Cyril
    @Entity // Annotation indiquant que la classe est un entity bean
    public class Personne implements Serializable{
    private int id;
    private String firstname;
    private String lastname;
    private Contact contact;
    @Id
    @GeneratedValue(strategy=GenerationType.AUTO)
    public int getId() {
    return id;
    public void setId(int id) {
    this.id = id;
    @OneToOne(mappedBy="personne")
    public Contact getContact() {
    return contact;
    public void setContact(Contact contact) {
    this.contact = contact;
    public String getFirstname() {
    return firstname;
    public void setFirstname(String firstname) {
    this.firstname = firstname;
    public String getLastname() {
    return lastname;
    public void setLastname(String lastname) {
    this.lastname = lastname;
    }et le requete
    em.createQuery("SELECT contact.lastname FROM Contact AS contact JOIN contact.personne AS personne").getResultList(); but no join

  • How to avoid Duplicate Records  while joining two tables

    Hi,
    I am trying to join three tables, basically two tables are same one is like history table, so I wrote a query like
    select
    e.id,
    e.seqNo,
    e.name,
    d.resDate,
    d.details
    from employees e,
    ((select * from dept)union(select * from dept_hist)) d
    join on d.id=e.id and e.seqno=d.seqno
    but this returing duplicate records.
    Could anyone please tell me how to avoid duplicate records of this query.

    Actually it is like if the record is processed it will be moved to hist table, so both table will not have same records and I need the record from both the tables so i have done the union of both the tables, so d will have the union of both records.
    But I am getting duplicate records if even I am distinct.

  • How do I join two tables in the same database and load the result into a destination table in a SSIS package

    Hi,
    I have a query that joins two tables in the same database, the result needs to be loaded in a destination DB table.  How do I do this in SSIS package?
    thank you !
    Thank You Warmest Fanny Pied

    Please take a look at these links related to your query.
    http://stackoverflow.com/questions/5145637/querying-data-by-joining-two-tables-in-two-database-on-different-servers
    http://stackoverflow.com/questions/7037228/joining-two-tables-together-in-one-database

  • How to prevent Oracle from using an index when joining two tables ...

    How to prevent Oracle from using an index when joining two tables to get an inline view which is used in an update statement?
    O.K. I think I have to explain what I mean:
    When joining two tables which have many entries sometimes it es better not to use an index on the column used as join criteria.
    I have two tables: table A and table B.
    Table A has 4.000.000 entries and table B has 700.000 entries.
    I have a join of both tables with a numeric column as join criteria.
    There is an index on this column in table A.
    So I instead of
      where (A.col = B.col)I want to use
      where (A.col+0 = B.col)in order to prevent Oracle from using the index.
    When I use the join in a select statement it works.
    But when I use the join as inline view in an update statement I get the error ORA-01779.
    When I remove the "+0" the update statement works. (The column col is unique in table B).
    Any ideas why this happens?
    Thank you very much in advance for any help.
    Regards Hartmut

    I think you should post an properly formatted explain plan output using DBMS_XPLAN.DISPLAY including the "Predicate Information" section below the plan to provide more details regarding your query resp. update statement. Please use the \[code\] and \[code\] tags to enhance readability of the output provided:
    In SQL*Plus:
    SET LINESIZE 130
    EXPLAIN PLAN FOR <your statement>;
    SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY);Usually if you're using the CBO (cost based optimizer) and have reasonable statistics gathered on the database objects used the optimizer should be able to determine if it is better to use the existing index or not.
    Things look different if you don't have statistics, you have outdated/wrong statistics or deliberately still use the RBO (rule based optimizer). In this case you would have to use other means to prevent the index usage, the most obvious would be the already mentioned NO_INDEX or FULL hint.
    But I strongly recommend to check in first place why the optimizer apparently seems to choose an inappropriate index access path.
    Regards,
    Randolf
    Oracle related stuff:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle:
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

Maybe you are looking for