UPPER built in function (BIF) of Oracle

Hello:
I have a SQL that uses UPPER function.
select id from employee where upper(ID)= upper('123A') ;
It does a full table scan ( in the absence of a functional index on ID ). Now the question is, is Oracle smart enough to skip using the UPPER function if I send a numeric value say '567'
select id from employee where upper(ID)= upper('567') ;
If there are any links to prove it does or does not please post.
TIA

PLAN_TABLE_OUTPUT
Plan hash value: 441474920
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
PLAN_TABLE_OUTPUT
| 0 | SELECT STATEMENT | | 485K| 18M| 793K (1)| 02:38:40 |
|* 1 | TABLE ACCESS FULL| EMPLOYEE | 485K| 18M| 793K (1)| 02:38:40|
Predicate Information (identified by operation id):
PLAN_TABLE_OUTPUT
1 - filter(UPPER("ID")='123A')
13 rows selected.
SQL> EXPLAIN PLAN
2 SET STATEMENT_ID = 'bad1' FOR
3 select prev_ID from EMPLOYEE where upper(ID)= upper('567')
Explained.
PLAN_TABLE_OUTPUT
Plan hash value: 441474920
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
PLAN_TABLE_OUTPUT
| 0 | SELECT STATEMENT | | 485K| 18M| 793K (1)| 02:38:40 |
|* 1 | TABLE ACCESS FULL| EMPLOYEE | 485K| 18M| 793K (1)| 02:38:40 |
Predicate Information (identified by operation id):
PLAN_TABLE_OUTPUT
1 - filter(UPPER("ID")='567')
13 rows selected.
Edited by: Anveshita on Nov 11, 2011 9:08 AM

Similar Messages

  • Built in Function to Populate an access table from an Oracle Table through VB 6.0

    Dear all,
    Is there any built in function in VB 6.0 to populate an access table directly from an oracle table or SQL Server(Assume Both has the same columns & data type).
    (Just like the DoCmd command which can be used to populate an excel sheet directly from an access table).
    Please help.
    Regards
    Sibby.

    Sibby,
    There is no "built-in" code in VB that I am aware of. However, you could use this code which I wrote for SQL Server. For Oracle, you would have to change to the appropriate table to get all the table names. You can filter by table name to get just your tables like I did below (My_).
    '* Now select all the files and add to access.
    sSQL = "SELECT name, id FROM sysobjects WHERE xtype = 'U' AND SUBSTRING(name, 1, 3) = 'My_' ORDER BY name"
    Set rstTemp = OpenRdSetView(sSQL:=sSQL, adoConnection:=adoConnection)
    On Error GoTo TableExistError
    '* Loop through all my database tables and copy to the Access database.
    With rstTemp
    Do While Not .EOF
    '* Copy this to the Access backup database.
    sTableName = .Fields("Name").Value
    '* Select all records from the SQL Server table and copy to the local Access database.
    sSQL = "SELECT * INTO " & sTableName & " FROM "
    sSQL = sSQL & "[odbc;dsn=" & sDSN & ";UID=" & sUID & ";pwd=" & spwd & ";]." & sTableName
    adoBackupConnection.Execute sSQL, , adExecuteNoRecords
    '* Go to next table.
    .MoveNext
    Loop
    End With

  • Built-in functions for Forms in Oracle AS 10g

    Hi,
    We have recently installed form and report services for AS10g.
    Altough we have successfully converted and deployed static 6i forms to the server, the built in functions (like CALL FORM etc.) doesn't work.
    For instance a form is diplayed and is able to retrieve data but it does actually nothing when a button is pressed with underlying CALL_FORM, SET_WINDOW_PROPERTY functions.
    In our developer's devSuite these functions work fine, so I wonder if some service to be added to the server side.
    Any help will be appreciated,
    Thanks,
    Guney Hanedan

    If your development and target systems are different make sure you regenerate the FMX files...also make sure you have the correct case....in windows CALL_FORM('FormA') is will call a form called FORMA or ForMA or FORma..if you are deployed on unix or linux this will fail .
    REgards
    Grant Ronald
    Oracle Product Management

  • Oracle built in function

    I am in search of built in functions:
    ->The first function I am in search of is one that I will produce a date, and the function should return the month of that date. So if I produce 01-Jan-2000, the function should produce JAN. Is there a ready made built in function in HR\Payroll that does this .
    -> The second one is needed to return the Payroll Start date. So by that I am hoping to produce a date within the payroll period , and I want the function to return the Start Date and the Payroll End date which that date falls in.
    And my last question is, is there an easy way of me finding out if these functions are already in the system ... so if I'm in search of particular function is there a way of me knowing whether it is there or not?
    Thanks in advance..

    Hi, regarding your questions
    user11218115 wrote:
    I am in search of built in functions:
    ->The first function I am in search of is one that I will produce a date, and the function should return the month of that date. So if I produce 01-Jan-2000, the function should produce JAN. Is there a ready made built in function in HR\Payroll that does this .
    You can use TO_CHAR(<your date>,'MON')
    -> The second one is needed to return the Payroll Start date. So by that I am hoping to produce a date within the payroll period , and I want the function to return the Start Date and the Payroll End date which that date falls in.
    You can use something like this (the actual query will depend on the name of your table and columns):
    SELECT effective_start_date, effective_end_date
    FROM pay_all_payrolls_f
    WHERE <your date> BETWEEN effective_start_date AND effective_end_date
    -- And maybe other conditions to make the query return just one row
    And my last question is, is there an easy way of me finding out if these functions are already in the system ... so if I'm in search of particular function is there a way of me knowing whether it is there or not?
    Not sure if easy or not, but there are plenty of documentation on Oracle products. For instance:
    Oracle DB 11gR2
    http://www.oracle.com/technology/documentation/database.html
    Oracle Applications (eBusiness Suite)
    http://www.oracle.com/technology/documentation/applications.html
    And of course, you have the Oracle forums.
    Hope it helps.

  • FUNCTION-BASED INDEX ( ORACLE 8I NEW FEATURE )

    제품 : ORACLE SERVER
    작성날짜 : 2004-08-16
    FUNCTION-BASED INDEX ( ORACLE 8I NEW FEATURE )
    ==============================================
    SCOPE
    10g Standard Edition(10.1.0) 이상 부터 Function-based Index 기능이 지원된다.
    Explanation
    1. 개요
         Function-based index는, 함수(function)이나 수식(expression)으로 계산
    된 결과에 대해 인덱스를 생성하여 사용할 수 있는 기능을 제공한다.
         질의 수행 시 해당 함수나     수식을 처리하여     결과를 가져 오는 것이 아니라,
         인덱스 형태로 존재하는 미리 계산되어 있는 결과를 가지고 처리하므로
         성능 향상을 기할 수 있다.
    2. 제약사항
    1) aggregate function 에 대한 function-based index 생성 불가.
    (예 : sum(...) )
    2) LOB, REF, nested table 컬럼에 대한 function-based index 생성 불가.
    3. 주요 특징
         1) cost-based optimizer에 의해 사용됨.
         2) B*Tree / bitmap index로 생성 가능.
         3) 산술식 (arithmetic expression), PLSQL function, SQL built-in
    function 등에 적용 가능.
         4) 함수나 수식으로 처리된 결과에 대한 range scan 가능
         5) NLS SORT 지원
         6) SELECT/DELETE를 할 때마다 함수나 수식의 결과를 계산하는 것이 아니라
         INSERT/UPDATE 시 계산된 값을 인덱스에 저장.
         7) 질의 속도 향상
         8) object column이나 REF column에 대해서는 해당 object에 정의된
         method에 대해 function-based index 생성 가능.
    4. 생성 방법
         CREATE [UNIQUE | BITMAP ] INDEX <index_name>
         ON <tablename> (<index-expression-list>)
         <index-expression-list> -> { <column_name> | <column_expression> }
         예) CREATE INDEX EMP_NAME_INDEX ON EMP (UPPER(ENAME));
         CREATE INDEX EMP_SAL_INDEX ON EMP( SAL + COMM, empno);
         * Function-based index를 생성하기 위해서는 QUERY REWRITE 권한이
         부여 되어 있어야만 한다.
         예) GRANT QUERY REWRITE TO SCOTT;
    5. Function-Based Index 사용을 위한 사전 작업
         1) Function-based index는 cost based optimizer에서만 사용 가능하므로,
         테이블에 대해 미리 analyze 해 주는 것이 바람직하다.
         그리고 init 파일에서 OPTIMIZER_MODE 를 FIRST_ROWS 나 ALL_ROWS 등으
    로 지정하거나 HINT 등을 사용하여 cost based optimizer가 사용되도록
    한다.
         2) init 파일에서 COMPATIBLE 파라미터 값을 8.1 이상으로 설정되어 있어야
    한다.
         ( 예 : COMPATIBLE = 8.1.6 )
         3) session/instance level 에서 QUERY_REWRITE_ENABLED 값이 TRUE 지정
    되어 있어야 한다.
         ( 예 : ALTER SESSION SET QUERY_REWRITE_ENABLED = TRUE; )
    6. 예제
         1) init 파라미터에서 다음과 같이 지정
         compatible = 8.1.6 (반드시 8.1이상이어야 한다)
         query_rewrite_enabled = true
         query_rewrite_integrity = trusted
         2) SCOTT 유저에서 function_based_index 생성
         create index idx_emp_lower_ename
         on emp
         ( lower(ename) ) ;
         3) EMP table analyze
         analyze table emp compute statistics ;
         4) PLAN_TABLE 생성
         @ ?/rdbms/admin/utlxplan.sql
         5) Cost based optimizer 선택
         alter session set optimizer_mode = FIRST_ROWS ;
         6) Query 실행
         explain plan set statement_id='qry1' FOR
         select empno, ename
         from emp
         where lower(ename) = 'ford' ;
         7) PLAN 분석
         SELECT LPAD(' ',2*level-2)||operation||' '||options||' '||object_name query_plan
         FROM plan_table
         WHERE statement_id='qry1'
         CONNECT BY prior id = parent_id
         START WITH id = 0 order by id ;
         -> 결과
         QUERY_PLAN
         SELECT STATEMENT
         TABLE ACCESS BY INDEX ROWID EMP
         INDEX RANGE SCAN IDX_EMP_LOWER_ENAME
    7. 결론
    Function-based index는 적절하게 사용될 경우 성능상의 많은 이점을 가져
    온다. Oracle8i Designing and Tuning for Performance에서도 가능한 한
    Function-based index를 사용하는 것을 권장하고 있으며, LOWER(), UPPER()
    등의 함수를 사용하여 불가피하게 FULL TABLE SCAN을 하는 경우에 대해서도
    효과적으로 처리해 줄 수 있는 방안이라 할 수 있다.
    Reference Documents
    -------------------

    Partha:
    From the Oracle8i Administrators Guide:
    "Table owners should have EXECUTE privileges on the functions used in function-based indexes.
    For the creation of a function-based index in your own schema, you must be
    granted the CREATE INDEX and QUERY REWRITE system privileges. To create
    the index in another schema or on another schemas tables, you must have the
    CREATE ANY INDEX and GLOBAL QUERY REWRITE privileges."
    Hope this helps.
    Peter

  • Reg : Context-switching for built-in functions -

    Hi Experts,
    Asking this question just out of curiosity to know the internal concepts.
    In a SQL query often we use the in-built Oracle functions like LOWER, UPPER, etc.
    In this case, does context-switch happen?
    Will I be able to look into the code of these functions after logging into SYS schema as SYSDBA?
    FYI - I've Oracle XE 11.2 installed in my home pc (currently in office, so don't have access to it).
    Help much appreciated!
    Thanks,
    Ranit

    ranit B wrote:
    Hi Experts,
    Asking this question just out of curiosity to know the internal concepts.
    In a SQL query often we use the in-built Oracle functions like LOWER, UPPER, etc.
    In this case, does context-switch happen?No, because many of these functions are compiled at low level (C language) into the SQL and the PL/SQL engines, so each has their own 'copy' (in theory) to execute without having to context switch to the other engine.
    Will I be able to look into the code of these functions after logging into SYS schema as SYSDBA?No, they are written in C and compiled into the engines.
    In terms of the supplied packages (rather than built in functions), many of those are wrapped by oracle so you can only see the public interface, not the actual body code.

  • List of Built in Functions

    Hi,
    Can anyone tell me how to get list of built in Oracle functions..eg(Sum,Count,Trim,etc)..
    Thanx in adv
    Balajee

    Hi,
    When we install Oracle Discoverer, it loads a table EUL functions which has some built in functions and its parameters, whcih in turn is used by the Report of Dicoverer.so in that line can we have something which loads the built in fiunctions into a table..
    Balajee

  • Can i create any procedure or function inside a oracle reserve package?

    Hi!
    Can i create any procedure or function inside a oracle reserve package. Suppose, I want to create a function called x in the dbms_output package. Can i do that? Or can i extend the features of this package and create/derived a function from it like we extend any class in JAVA. I'm not sure - whether this is at all possible. I'll be waiting for your reply.
    Thanks in advance.
    Satyaki De.

    No, but you can write a wrapper package and use that instead of using the Built-In package directly. So, instead of calling DBMS_OUTPUT, you call your own Package.
    Steven Feuerstein wrote a wrapper for DBMS_OUTPUT, called P:
    Re: DBMS_OUTPUT.PUT_LINE

  • [SQL Server]'TO_DATE' is not a recognized built-in function name

    Running 11g dg4msq and getting the error :
    SQL> select * from all_users@dg4msql;
    select * from all_users@dg4msql
    ERROR at line 1:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    [Oracle][ODBC SQL Server Driver][SQL Server]'TO_DATE' is not a recognized
    built-in function name. {10196,NativeErr = 195}

    Hi,
    This problem happened on Windows platforms after upgrading the RDBMS used to access the gateway from 10.2.0.3 to 10.2.0.4 patch 22.
    The solution is to install and apply Oracle Database 10.2.0.4 Patch 29 (Windows Bundle Patch 29) or later to the RDBMS that is running the query and connecting to the Gateway.
    This is detailed in the following note available on My Oracle Support -
    Query Using DG4MSQL Returns Error After Upgrade of RDBMS From 10.2.0.3 to 10.2.0.4 (Doc ID 1078940.1)
    Regards,
    Mike

  • How to find built-in functions for PL/SQL

    Hi everyone,
    Please can someone help me, I am running version 8i, and I am trying to find out how I can access all the built-in functions for PL/SQL.
    I am new in ORACLE environment and I just want to know all the built-in functions and their usage.
    Thanks
    Maikiki1
    null

    Use the 'Documentation' selection on the left side of the OTN page.
    All of the documentation for Oracle is available.
    You can also purchase the documentation CD-ROM from the Oracle Store.
    The functions are explained in the SQL reference manual.
    null

  • How to view SQL Built-In function Codings ?

    Hello All
    I want to view the sql built-in functions codings,any one say how to view this, or any web links contains this
    for ex --- i want to view the round function coding
    Thanks

    user2233 wrote:
    I want to view the sql built-in functions codings,any one say how to view this, or any web links contains this
    for ex --- i want to view the round function codingIf you mean seeing the actual source code for the SQL round() function, then no - not possible. It is part of the copyrighted (and private) Oracle source code.
    If you want to see what functions there are, what the syntax is and arguments are, what the functions do, then refer to the Oracle® Database SQL Language Reference guide.

  • Is there any built in function that prints numbers in words inXMLP

    Hi Team,
    This is regarding SR#3-7005716301 from Syntel Limited.
    Customer is asking Is there any built in function that prints numbers in words in an rtf teamplate using xml publisher?
    For example if the net amount is 100 dollars then it should print "ONE HUNDRED DOLLARS AND ZERO CENTS ONLY"
    Thanks in advance!
    Leo

    I do not know of any function available that lets you print the currency words (dollars, cents etc). Here is a link to a blog post that will allow you to print numbers in words.
    https://blogs.oracle.com/xmlpublisher/entry/numbers_to_words_update
    Thanks,
    Bipuser

  • How to override the built in functions

    hi,
    how can we override the built-in functions like create, delete in ADF. I need to write a code that would work for the entire data model instead of only the view object in question. There are a set of actions and operations that should be dealt thru the template and only few operations thru the main/master screen.
    thanks all,
    Jyothi

    You can override specific methods for EOs see here:
    http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcservices.htm#CHDEIFFG
    Or if you want to change the behavior for all your EOs create an extension as described here:
    http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcadvgen.htm#sm0291

  • DB built-in function

    Happy Friday everyone,
    I am newbie in Oracle and I don't really understand Oracle DB built-in function.
    I type below sql in sqlplus:
    select weeks_look_behind from dual;
    and I get result
    WEEKS_LOOK_BEHIND
    200
    Where is result from? Is WEEKS_LOOK_BEHIND same like TIME_DATE? Are they DB system built-in functions?
    Many thanks!

    I am newbie in Oracle and I don't really understand Oracle DB built-in functionWEEKS_LOOK_BEHIND is not an Oracle built-in function. So it is something written by a developer on your database. You can find out what it does by running this query
    select text from user_source
    where name = 'WEEKS_LOOK_BEHIND'
    order by line
    /I'm presuming that the object is in your current schema. If it isn't you will need to track it down by
    select owner, object_type from all_objects
    where object_name = 'WEEKS_LOOK_BEHIND'
    /Cheers, APC
    blog: http://radiofreetooting.blogspot.com

  • How to use a mysql built-in function with dataprovider

    hi.
    I want to use a mysql built-in function, for example, MD5() on a column when updating a table with dataprovider.
    Something like this doesn't work:
    MyDataProviderOne.setValue("tablename.field_name", "MD5('some text')");
    How should it be done?
    thanks.
    Mike.

    hi.
    thanks. this helped, but I'd like to use also different functions, that's why, I'd rather do it by MySQL built-in functions with dataprovider... Is there any way to do that?
    best regards.
    Mike.

Maybe you are looking for

  • Last 6 months of data from current date

    Hi Experts, I have a requirement in WebI to display last 6 months of data based on current date.Actually I have a column called "Employee Contract Start date" in my report.Suppose the end user executes the report today,then he should be able to see t

  • My MacPro crashes when hooked up to my iHome mini pop-up speakers, any reason?

    This is the 4th time my MacBook Pro has crashed, each time I was listening to music via iTunes with my iHome mini pop-up speakers connected.  Anyone know what is going on?

  • HDMI issue on Qosmio F60-111

    Dear all I have a strange problem with my laptop HDMI port. I've searched a lot, read the user manual, tried every solution available online and yet was not able to solve the problem. I connected the HDMI cable between the laptop and LG LCD screen wh

  • Tethering crash my Mac mini server

    I am using Mac Mini Server with 10.6.4 snow leopard sever. When I using iphone 4 tethering as my internet source for about 30 minutes, my mac mini server crash. I don't no what happend. Could somebody please help?

  • Acrobat Standard Language Change?

    Hello, I currently have a friend visiting from Europe, he has Adobe Acrobat 8 Standard edtion installed.  He now has some issue and wanted my help with it.  Unfortunately I can't read what looks like German to me.  Is there a way I can change the lan