Which column first filter by  oracle optimizer

Can somebody help in understand which column first filter by oracle optimizer in below example and why?
select * from emp where ENAME ='FORD'
AND SAL=3000 ;

Hi,
Look at the EXPLAIN PLAN.
Other things being equal, if there are more distinct values of ename than of sal, then it's probably checking for 'FORD' first.
For example, say the table has 100,000 rows, and there are 10,000 distinct enames, and 100 distinct sals, both ename and sal are indexed, but there is no combined index.
If you search by sal first, that means you'll expect around 1,000 rows from the index search, and then you'll have to test each of those 1,000 rows for the right ename.
If you search by ename, first, that means you'll expect around 10 rows from the index search, and you'll only have to test each of those 10 rows for the right sal.
The order in which the conditions were written will matter.
Edited by: Frank Kulash on Apr 2, 2012 7:54 AM

Similar Messages

  • How can i extend the filter function to also include an option to select which column to filter on?

    Hi.
    I have built an spry test-page (testing it on my localhost  so i cannot give you direct access to it) here i have an XML file that i show in an dynamic/ repeat table with 5 columns.
    I hvae included an spry filter function to easy filter out records, but the code only allows me to filter on one of the columns.
    I would like to add an extra "select-menu" to define which column the filter should be active for, how can i do that
    Here is the filter code and also the html code for the select-menu and the box to type in what to filter.
    The bold parts is the important parts, i would like the options values from the select menu to be inserted in the filterData function to be able to define which column to do the filtering on.
    var ds1 = new Spry.Data.XMLDataSet("report3.xml", "orders/order", {sortOnLoad: "@id", sortOrderOnLoad: "descending"});
    ds1.setColumnType("date", "date");
    ds1.setColumnType("BUTIKNR", "number");
    ds1.setColumnType("EXTRAFRAKT", "number");
    ds1.setColumnType("job/@idx", "number");
    var jobs = new Spry.Data.NestedXMLDataSet(ds1, "job");
    function FilterData()
        var tf = document.getElementById("filterTF");
        var menu = document.getElementById("searchIdent");
        if (!tf.value)
            // If the text field is empty, remove any filter
            // that is set on the data set.
            ds1.filter(null);
            return;
        // Set a filter on the data set that matches any row
        // that begins with the string in the text field.
        var regExpStr = tf.value;
        if (!document.getElementById("containsCB").checked)
            regExpStr = "^" + regExpStr;
        var regExp = new RegExp(regExpStr, "i");
        var filterFunc = function(ds, row, rowNumber)
            var str = row["@id"];
            if (str && str.search(regExp) != -1)
                return row;
            return null;
        ds1.filter(filterFunc);
    function StartFilterTimer()
        if (StartFilterTimer.timerID)
            clearTimeout(StartFilterTimer.timerID);
        StartFilterTimer.timerID = setTimeout(function() { StartFilterTimer.timerID = null; FilterData(); }, 100);
    html:
                <select name="searchIdent" size="1" id="searchIdent">
                    <option value="@id" selected="selected">ID</option>
                    <option value="date">DATUM</option>
                    <option value="time">TID</option>
                    <option value="BUTIKNR">BUTIK</option>
                    <option value="REF">REFERENS</option>
                  </select>
              <input type="text" id="filterTF" onkeyup="StartFilterTimer();" />
    Contains:
      <input type="checkbox" id="containsCB" /></td>
    Thanks in advance.
    //Rickard H

    Now it works, i had to do it like this:
        var filterFunc = function(ds, row, rowNumber)
            var str = row["@id"];
            if (str && str.search(regExp) != -1)
                return row;
            var str1 = row["date"];
            if (str1 && str1.search(regExp) != -1)
                return row;
            var str2 = row["time"];
            if (str2 && str2.search(regExp) != -1)
                return row;
            var str3 = row["BUTIKNR"];
            if (str3 && str3.search(regExp) != -1)
                return row;
            var str4 = row["REF"];
            if (str4 && str4.search(regExp) != -1)
                return row;
            return null;
    I also had to remove the line "ds1.setColumnType("BUTIKNR", "number");" from the code, otherwise it would not search at all (only searches string types?).

  • Find out which column is encrypted in oracle 9i

    Hi,
    I would like to know that which table/column is encrypted in oracle 9i?
    Is it any Data dictionary view or any other query?
    Appreciate your help!
    thanks,

    If your application is storing encrypted data in Oracle, the Oracle data dictionary will have no idea that the data is encrypted. Assuming you're storing encrypted data in RAW/ BLOB columns rather than risking storing it in VARCHAR2 columns, you could query the data dictionary for columns whose data type is RAW or BLOB, but that's a rather imprecise metric. There might well be non-encrypted columns that are storing binary data in RAW or BLOB columns.
    In 10g and later, if you are using transparent data encryption (TDE), you will see entries in the DBA_ENCRYPTED_COLUMNS view which will tell you which columns Oracle is encrypting. But, again, since Oracle has no idea whether the data Java is sending is encrypted or unencrypted, if your application is doing the encryption, these tables won't reflect that fact.
    Justin

  • Solution to allow users to specify which columns of a sql report to search

    Starting Point:
    1) You have an existing SQL Report.
    2) You want to provide functionality to search through the result set.
    Start -----
    1) add a text_item for searching PX_search where X is page number
    2) add a button which resubmits the page. Go
    3) You modify your query by adding the following to the end of the where clause.
    and (PX_SEARCH is null or instr(column_name1,PX_SEARCH) > 0 )
    4) So far so good but it only allows searches on 1 column, so you add a few other columns
    and (PX_SEARCH is null or instr(column_name1,PX_SEARCH) > 0 or instr(column_name2,PX_SEARCH) > 0 or instr(column_name3,PX_SEARCH) > 0 )
    Now when you enter some text if it is in any of the columns that row will be displayed.
    This can be good or bad depending on your requirement. lets say my users want to specify the column they are searching on.
    5)further enhancement
    i) add a LOV to your page which queries the all_users data dictionary view
    select column_name d, column_name r from all_users where table_name = 'MY_TABLE_NAME' and column_name not in ('COLUMN_NAME1,COLUMN_NAME2) order by column_name
    The idea here is to use the oracle data dictionary to get all the columns for your table(s) and ignore the columns you do not want.
    ii) add an item to your page e.g. PX_select_column which gets populated from the list of values.
    Now for each column you are going to allow a search on, the sql needs to be modified.
    Lets pretend that my firstcolumn is called member_id, my second column is called firstname and my third column is lastname
    Before we had this SQL
    (select * from table where 1=1)
    and (PX_SEARCH is null or instr(memberid,PX_SEARCH) > 0 or instr(firstname,PX_SEARCH) > 0 or instr(lastname,PX_SEARCH) > 0 )
    Remember we have added PX_SELECT_COLUMN which should contain what we have selected from the LOV.
    iii) So now we modify the query to be as follows:
    and (PX_SEARCH is null or decode(:PX_SELECT_COLUMN,'MEMBERID',instr(memberid,PX_SEARCH),0) > 0 or
    decode(:PX_SELECT_COLUMN,'FIRSTNAME',instr(firstname,PX_SEARCH),0) > 0 or
    decode(:PX_SELECT_COLUMN,'LASTNAME',instr(lastname,PX_SEARCH),0) > 0 )
    The user can now choose which column to filter their results on.

    Here is a basic one (http://apex.oracle.com/pls/otn/f?p=2230:1). You can select an object type and put in criteria for the object name like '%b%'. The SELECT statement is dynamically generated with only the pieces of the WHERE clause that are needed. You do not need all the DECODE and INSTR OR logic.
    The main part of this example is the computation of the SQL SELECT statement:
    DECLARE
      v_sql VARCHAR2(2000) := 'SELECT *'||CHR(10)||'  FROM USER_OBJECTS';
      v_and BOOLEAN := FALSE;
      v_where VARCHAR2(2000);
    BEGIN
      -- P1_OBJECT_TYPE has value of 'ALL' for '%'
      IF (:p1_object_type != 'ALL') THEN
        v_sql := v_sql || chr(10) ||
                 ' WHERE object_type = '''||:p1_object_type||'''';
        v_and := TRUE;
      END IF;
      IF (:p1_object_name IS NOT NULL) THEN
        IF (v_and) THEN
          v_sql := v_sql || chr(10) ||
                   '   AND object_name LIKE UPPER('''||:p1_object_name||''')';
        ELSE
          v_sql := v_sql || chr(10) ||
                   ' WHERE object_name LIKE UPPER('''||:p1_object_name||''')';
        END IF;
        v_and := TRUE;
      END IF;
      :p1_sql := v_sql;
      RETURN (v_sql);
    END;Mike

  • How to create a report region which the first colomn is row selector column

    I want to create a report region and its first column is a row selector column. I have used select sentence to select some columns. But I do not know how set the first column to row selector column. I mean I want to do as follow. When a radio which is first column is chosen, it will return it's value of the column in the chosen row. Please help me! Thanks

    Hi unnamed,
    Suppose you have an id that identifies your record.
    Go to Report definiton, tab report attirbutes.
    Select the id of your record.
    Create a link to the page you want to go to.
    Hope this helps.
    If not, I suggest you to create a from with report, and analyze the way the wizard has generated it.
    Leo

  • At which column i will create index ????

    my query is as follows and please tell me at which column of the table i would create an index
    select code, detail, nvl(sum(dr)-sum(cr),0) from spda
    where sdate < '01-feb-09'
    order by codebecause the query result very slow as there is above 3 million record in a table
    Regards
    M. Laeeque A.
    Edited by: MLA on Feb 27, 2009 12:02 PM

    MLA wrote:
    my query is as follows and please tell me at which column of the table i would create an index
    select code, detail, nvl(sum(dr)-sum(cr),0) from spda
    where and sdate < '01-feb-09'because the query result very slow as there is above 3 million record in a tableYou've posted this request three times (with three different versions of above statement).
    Which one would you like to get replied to?
    If this is the nested subquery that is part of the query posted here: Query Response Very Slow
    you should consider that the nested subquery is correlated to the outer query by this additional predicate:
    WHERE  SUBSTR(spda.mcode,1,2) || '-' || SUBSTR(spda.mcode,3,4) =
                    SUBSTR(ac.code,1,2)    || '-' || SUBSTR(ac.code,3,4)So in order to optimize the nested subquery access path this should be taken into account.
    As I've already pointed out in the other thread, getting rid of the nested subquery and instead using regular joins probably offers the best performance.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • GEOCODING: Indices on GC_Tables on which columns?

    Hi
    We use ORACLE 10gR2 Geocoder for geocoding Europe.
    In order to tune performance to the max, which columns shall be indexed on tables GC_ROAD_SEGMENT_XX, GC_ROAD_XX, GC_POSTAL_CODE_XX.
    Any field reports or developers' advice?
    Many thanks.
    Sebastian

    Here are the indexes required for the geocoder tables.
    Make sure the indexes are named with these names as we use hints
    in some SQL statements to force the optimizer to pick
    these indexes for certain queries.
    The three columns here are:
    Table Name Index-Name indexed-Columns
    gc_road_segment_<table_extension>     idx_<table_extension>roadgeom     geometry
    gc_road_segment_<table_extension>     idx_<table_extension>roadseg_rid     Road_id, start_hn, end_hn
    gc_road_<table_extension>     idx_<table_extension>roadsetbn     settlement_id, base_name
    gc_road_<table_extension>     idx_<table_extension>roadmunbn     municipality_id, base_name
    gc_road_<table_extension>     idx_<table_extension>roadparbn     parent_area_id, country_code_2, base_name
    gc_road_<table_extension>     idx_<table_extension>roadsetbnsd     settlement_id, soundex(base_name)
    gc_road_<table_extension>     idx_<table_extension>roadmunbnsd     municipality_id, soundex(base_name)
    gc_road_<table_extension>     idx_<table_extension>roadparbnsd     parent_area_id, country_code_2, soundex(base_name)
    gc_intersection_<table_extension>     idx_<table_extension>inters      Countrycode_2, road_id_1, road_id_2
    gc_area_<table_extension>     idx_<table_extension>areaname_id     Country_code_2, area_name, admin_level
    gc_area_<table_extension>     idx_<table_extension>areaid_name     area_id, area_name, Country_code_2
    gc_poi_<table_extension>     idx_<table_extension>poiname     Country_code_2, name
    gc_poi_<table_extension>     idx_<table_extension>poisetnm     Country_code_2, settlement_id, name
    gc_poi_<table_extension>     idx_<table_extension>poi munnm     Country_code_2, municipality_id, name
    gc_poi_<table_extension>     idx_<table_extension>poi regnm     Country_code_2, region_id, name
    gc_postal_code_<table_extension>     idx_<table_extension>_ postcode     Country_code_2, postal_code
    siva

  • Columns Display Support in Oracle 10g Express Edition..................

    I am working with the Oracle 10g Express Edition, and I Created a Table with 52 Fields and even successfully inserted data into the table via Java Program. But the problem is when I am displaying the table from the Oracle 10g Express Edition Interface, it is displaying only first 31 Fields and displaying "<div class="fielddata">First 31 columns displayed.</div>". What should i do if I want to display all the 52 columns. Awaiting for the Reply. Thank You..

    duplicate post
    Columns Display Support in Oracle 10g Express Edition..................

  • Slow first connection using Oracle 10g xe and Visual Studio 2008

    {noformat}
    Good day,
    I'm slightly unaccustomed to using forums, so bear with me.
    My initial connection to the Oracle database takes approximately 30 seconds. It seems to be waiting for a connection before timing out and trying another connection which works, as all subsequent connections work immediately. I'm unsure how other people's responses in forums can help me due to the plethora of configurations, so here's mine. My comprehension of the oracle world is still growing, you'll have to explain the terms you're using for me, Hoping you can help.
    I'm using Visual Studio 2008, set to use 32 bit debug mode, on a Windows 7 Pro platform. Also using Oracle 10g Xe, and have installed the 32 bit version of ODAC 11.2 (11.2.0.1) to aid making a connection from Visual Studio to Oracle.
    I have a database set up and a user with system admin rights. This is all local for a programming project and will never see the light of day outside of my personal machine.
    I am using code to connect, not the GUI. I wish to code this project completely without the aid of the GUI. so my connection string within Visual Studio C# is (pw/id hidden)...
    string xe = "Data Source=xe;User Id=xxxxx;Password=xxxxx;";
    OracleConnection conn = new OracleConnection(xe);
    My c:\devsuitehome\network\admin\sqlnet.ora file is this:
    # sqlnet.ora Network Configuration File: C:\DevSuiteHome\network\admin\sqlnet.ora
    # Generated by Oracle configuration tools.
    SQLNET.AUTHENTICATION_SERVICES= (NTS)
    NAMES.DIRECTORY_PATH= (LDAP, TNSNAMES, EZCONNECT, ONAMES, HOSTNAME)
    And my c:\devsuitehome\network\admin\TNSNames.ora file is this:
    tnsnames.ora Network Configuration File: C:\DevSuiteHome\network\admin\tnsnames.ora
    Generated by Oracle configuration tools.
    XE =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = xe)
    EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = <machine name)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = PLSExtProc)
    Just for good measure, my tnsping xe shows:
    "Used paramter files:<br/>
    c:\devsuitehome\network\admin\sqlnet.ora<br/><br/>
    Used TNSNAMES adapter to resolve the alias<br/>
    Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521)))(CONNECT_DATA = (SERVICE_NAME = xe)))
    OK (0 msec)"
    So, how can I make that initial connection faster so I don't spend 15 years testing my application due to slow start-ups? :)
    Thank you.
    Kevin.
    {noformat}
    Edited by: 832285 on Jan 29, 2011 10:08 AM
    Edited by: 832285 on Jan 29, 2011 10:10 AM

    I have formatted my hard drive since my first post. I was running window 64 bit with a higher version of the ODAC and that proved to crash my machine with faulty error messages about memory. I have reverted to a previous version of the ODAC tools and everything works very smooth now. Still the connection time is consistently 20 seconds or longer on the first attempt.
    Just a little more information.. I am currently taking a college course with 15 other students, as you can tell by the impersonal machine name, where programming using visual studio 2008, and Oracle 10g xe is expected. All of us are using a 64 bit environment and we all have difficulties cutting down the load time of making the first connection to Oracle. Some people are longer making the connection, but none are shorter.
    One other note. After the first connection is made, taking 20 or more seconds, and is closed, all subsequent openings of the connection are instantaneous, for all of us.
    If there is ANYTHING more I can get for you, please let me know. With my environment stable as it is, I will not need to format or change any information for the foreseeable future.
    Here is the information you requested
    1 The connection method I am using, I have chosen the manual connection for you, however the delay exists if the connection is made through the GUI as well.
    Historically, I am getting slow connection speeds through adding the connection through the GUI or by a manual connection. Here is how I am doing it manually. I have the connection being created in 20 seconds, which is the best I can get.
    Imports Oracle.DataAccess.Client
    Also included project reference: oracle.dataaccess / version 2.111.6.20
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Dim connString As String = "Data Source=XE;User Id=abc;Password=abc;"
            Dim con As OracleConnection = New OracleConnection()
            con.ConnectionString = connString
            Try
                con.Open()
                MessageBox.Show("Connected!")
                con.Close()
                con.Dispose()
            Catch ex As Exception
                MessageBox.Show(ex.Message)
            End Try
        End SubMy current TNS Ping results
    TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 16-FEB-2011 01:02:36
    Copyright (c) 1997, 2005, Oracle.  All rights reserved.
    Used parameter files:
    C:\oraclexe\app\oracle\product\10.2.0\server\network\admin\sqlnet.ora
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = XE)))
    OK (0 msec)2 Connection to SQL plus is instantaneous.
    I fought for weeks about the ODAC version 11.2.0.1 that you see in the previous post, and that would be a whole new thread. Suffice it to say I have a reliable environment to program in with this 10.2.0.1.0 version that I am running now, and the connection time has not changed, it is still minimum 20 seconds load time, sometimes up to 25.
    3 Ram usage in my typical environment
    I am running this laptop with 4 gigs of ram. This is a typical environment I would be running my application in.
    Physical memory
    total 4090
    cached 1753
    available 2345
    free 656
    system
    handles 27141
    threads 911
    processes 70
    commit megs 2860/8179
    kernel memory megs
    paged 201
    nonpaged 52
    4 I formatted my machine and reinstalled the Windows 7 professional operating system as of a few nights ago. The Oracle software on my machine is
    Oracle Database 10g express edition
    ODAC 11.1.0
    I amm not sure what filename you would need in addition to the product names that I have installed.
    5 The information from the SET command is
    ALLUSERSPROFILE=C:\ProgramData
    APPDATA=C:\Users\stepheke\AppData\Roaming
    CommonProgramFiles=C:\Program Files\Common Files
    CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
    CommonProgramW6432=C:\Program Files\Common Files
    COMPUTERNAME=STEKEV0908
    ComSpec=C:\Windows\system32\cmd.exe
    FP_NO_HOST_CHECK=NO
    HOMEDRIVE=C:
    HOMEPATH=\Users\stepheke
    LOCALAPPDATA=C:\Users\stepheke\AppData\Local
    LOGONSERVER=\\STEKEV0908
    NUMBER_OF_PROCESSORS=2
    oracle_sid=xe
    OS=Windows_NT
    Path=C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Oracleapp\stepheke\product\11.1.0\client_1;C:\Oracleapp\stepheke\product\11.1.0\client_1\bin;C:\oraclexe\app\oracle\product\10.2.0\server\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;c:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\;C:\Program Files (x86)\Windows Live\Shared
    PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
    PROCESSOR_ARCHITECTURE=AMD64
    PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 23 Stepping 10, GenuineIntel
    PROCESSOR_LEVEL=6
    PROCESSOR_REVISION=170a
    ProgramData=C:\ProgramData
    ProgramFiles=C:\Program Files
    ProgramFiles(x86)=C:\Program Files (x86)
    ProgramW6432=C:\Program Files
    PROMPT=$P$G
    PSModulePath=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
    PUBLIC=C:\Users\Public
    SystemDrive=C:
    SystemRoot=C:\Windows
    TEMP=C:\Users\stepheke\AppData\Local\Temp
    TMP=C:\Users\stepheke\AppData\Local\Temp
    USERDOMAIN=stekev0908
    USERNAME=stepheke
    USERPROFILE=C:\Users\stepheke
    VS90COMNTOOLS=c:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools\
    windir=C:\Windows

  • Invoice amount is stored in which column?

    Hi
    In ra_customer_trx_lines_all Invoice amount is stored in which column?
    Thanks
    Prakash

    Hi Prakash,
    Please check links:
    http://prasanthapps.blogspot.com/2011/05/ar-query-to-get-open-invoices-for.html
    http://ebsanil.blogspot.com/2012/09/query-to-find-ar-invoices-posted-to-gl.html
    http://www.shareoracleapps.com/2011/05/query-open-ar-invoices-in-oracle-apps.html
    Thanks &
    Best Regards,

  • Parsing which columns used in a query

    Hi,
    i try to write my own advisor :-) I´m looking for a package that can help me to find out which columns a used in query in a codition
    Example:
    select 1 from emp
    where deptno=10
    and job='CLERK';
    => deptno and clerk
    I worked with col_usage$, but it seems not always correct, and it´s not updated when you zuse explain plan ...
    Does anybody know, how Oracle´s dbms_advisor/dbms_sqltune finds out which columns are used in a condition ?
    Thanks
    Marco

    mpatzwahl wrote:
    i try to write my own advisor :-)Oh dear, that is completely insane. Why not use the one provided?
    You would need to write a SQL parser.
    The language definition is here
    http://docs.oracle.com/cd/E11882_01/server.112/e26088/toc.htm
    And don't forget that a function could be used in the condition so you will need to parse PL/SQL also
    http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/toc.htm
    Try it out on something simple like this and see how far you get
    {message:id=1908539}
    SQL> create or replace function f1 return varchar2 as
      2  l_dummy dual.dummy%type;
      3  begin
      4    select dummy into l_dummy from dual;
      5    return l_dummy;
      6  end;
      7  /
    Function created.
    SQL> edi
    Wrote file afiedt.sql
      1  create or replace function f2 return varchar2 as
      2  begin
      3    return 'X';
      4* end;
    SQL> /
    Function created.
    SQL> create or replace view v as
      2  select
      3      dummy a,
      4      (select dummy from dual) b,
      5      f1 c,
      6      f2 d,
      7      'X' e
      8  from dual;
    View created.
    SQL> select * from v where c = 'X';
    A B C D E
    X X X X X

  • Which column raised the exception?

    SQL&gt; desc test
    Name Null? Type
    A NUMBER(5)
    B VARCHAR2(10)
    SQL&gt; insert into test values(1,'abcdefghijkl');
    insert into test values(1,'abcdefghijkl')
    ERROR at line 1:
    ORA-01401: inserted value too large for column
    How do I know that which column/value raised this exception? In this case, is there a way to identify that the column "B" has raised this exception?

    What version of oracle are you running? Here is a run on 10.2
    SQL> desc afb
    A VARCHAR2(1)
    B VARCHAR2(2)
    C VARCHAR2(3)
    SQL> select version from v$instance;
    VERSION
    10.2.0.1.0
    SQL> insert into afb values ('A','BBB','CC');
    INSERT INTO AFB VALUES ('A','BBB','CC')
    ERROR at line 1:
    ORA-12899: value too large for column "TEST"."AFB"."B" (actual: 3, maximum: 2)
    The error message tells you. In prior versions you could tell in pro from the indicator variable and OCI had a similar method, but in straight SQL you were more or less out of luck.

  • First Version of Oracle Application

    Which one is the first version of Oracle Apps

    AFAIK, there used to be 10.5 and 10.6 releases of Oracle E-Business Suite :)
    I even heard once there was 9.x release, so I am not sure what the first version is. My question is; why would you need to know the first version? Would this add any value to your knowledge?

  • Sql query hint - first filter , then join

    hello
    i have a following query (based on OWB data model views)
    select /* + LEADING(all_iv_xform_map_components all_iv_xform_map_parameters) USE_NL(all_iv_xform_map_components all_iv_xform_map_parameters) */
    comp.map_name,
    comp.operator_type ,
    param.map_component_name ,
    param.parameter_name,
    md.map_component_id,
    md.map_component_name,
    mp.MAP_COMPONENT_ID     ,
    mp.MAP_COMPONENT_NAME     
    from all_iv_xform_map_components comp,
    all_iv_xform_map_parameters param,
    ALL_IV_XFORM_MAP_PROPERTIES mp,
    ALL_IV_XFORM_MAP_DETAILS md
    where comp.map_name = nvl('&load_map_name','LOAD_MY_TABLE')
    and param.map_component_id = comp.map_component_id
    and param.map_component_id=md.map_component_id
    and md.map_component_id=mp.map_component_id
    what i want to achieve is to force the query to first filter out the table all_iv_xform_map_components and do the join with the remainign tables on the filtered rows only;
    i tried using the above hint but its not working; oracle still grabs to the full table: ALL_IV_XFORM_MAP_PROPERTIES
    id appreciate any tips
    thanks
    rgds

    HI
    for the sake of the case:
    i ran your query and its giving the clob error
    i hard coded the com id's and its not giving error anymore
    WITH comp AS
    (   SELECT --+materialize
            comp.map_name,
            comp.operator_type,
            comp.map_component_id,
            param.map_component_name ,
            param.parameter_name
        FROM
            all_iv_xform_map_components comp,
            all_iv_xform_map_parameters param
        WHERE
            comp.map_name = nvl('&load_map_name','LOAD_MY_TABLE)
        AND param.map_component_id = comp.map_component_id
        AND param.map_component_id  in ('3931622','3931625','3931624','3931623','3931626')  --> without this line its giving clob error, but these are the only comp ids retured by that query
    select
        comp.map_name,
        comp.operator_type ,
        comp.map_component_name ,
        comp.parameter_name,
        md.map_component_id,
        md.map_component_name,
        mp.MAP_COMPONENT_ID ,
        mp.MAP_COMPONENT_NAME
    from
        comp,
        ALL_IV_XFORM_MAP_PROPERTIES mp,
        ALL_IV_XFORM_MAP_DETAILS md
    where
        comp.map_component_id = md.map_component_id
    and comp.map_component_id = mp.map_component_id
    /

  • Htmlb_tableview - how to define which columns are visible

    Hello
    i am working on an MVC BSP application that renders to the screen 5 fields.
    Yet in the bsp definition I see it reads pt-requisition-list which has many fields.
    <htmlb:tableView id                  = "requilistTab"
                       headerText          = "<%= controller->tv_header %>"
                       headerVisible       = "true"
                       columnHeaderVisible = "true"
                       table               = "<%= controller->pt_requisition_list %>"
                       design              = "alternating"
                       width               = "100%"
                       visibleRowCount     = "20"
                       footerVisible       = "true"
                       emptyTableText      = "<%= otr(paoc_rcf_ui/no_requi) %>"
                       sort                = "SERVER"
                       onHeaderClick       = "dummy"
                       keyColumn           = "OBJID"
                       iterator            = "<%= controller %>"
                       filter              = "SERVER"
                       visibleFirstRow     = "<%= controller->visible_first_row %>"
                       selectedRowKey      = "<%= controller->selected_record-objid %>"
                       selectionMode       = "SINGLESELECT" />
    My question: how do you tell the bsp what fields to display?
    Thanks in advance
    yuval

    iterator = "<%= controller %>"
    this is what makes controlling the columns visible.
    go to the class (referenced by variable controller) and see the method IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS  to see the coding behind this.
    alternative method to show/hide columns without using iterator.
    page attribute:
    col_control_tab     TYPE     TABLEVIEWCONTROLTAB
    col_wa     TYPE     TABLEVIEWCONTROL
    layout
    <%
      clear col_wa .
      move: 'CARRID' to col_wa-columnname ,
      'This is the title of carrid' to col_wa-title ,
      'LEFT' to col_wa-horizontalalignment ,
       'ICON_PLANE' to col_wa-icon ,
      ' ' to col_wa-encode ,
      ' ' to col_wa-wrapping .
      append col_wa to col_control_tab .
      clear col_wa .
      clear col_wa .
      move: 'CONNID' to col_wa-columnname ,
      '<B>Connection</B>' to col_wa-title ,
      'X' to col_wa-sort ,
       'DESCENDING' to col_wa-preSelectedSortDirection ,
      'mycellclick' to col_wa-ONCELLCLICK ,
      'LEFT' to col_wa-horizontalalignment ,
      'X' to col_wa-encode .
      append col_wa to col_control_tab .
      clear col_wa .
    clear col_wa .
      move: 'FLDATE' to col_wa-columnname ,
      'Price' to col_wa-title ,
      'X' to col_wa-sort ,
      'LEFT' to col_wa-horizontalalignment ,
      ' ' to col_wa-encode .
      append col_wa to col_control_tab .
      clear col_wa .
          %>
    <htmlb:tableView id                  = "tv1"
                           design              = "ALTERNATING"
                           selectionMode       = "MULTISELECT"
                           onRowSelection      = "MYROWSELECTION"
                           table               = "<%= flights %>"
                         columnDefinitions   = "<%= col_control_tab %>"
                           tableLayout         = "AUTO"
                           width               = "50%"
                           columnHeaderVisible = "true"/>
    in this example  columnDefinitions  attribute determins which columns to be shown.

Maybe you are looking for