Difference between to queries while using UPPER

One confusion..
I see this, most of the places..
Select * from tableA
Where upper(colA) = upper(p_parameter);
Or
l_variable := upper(p_parameter);
Select * from tableA
Where upper(colA) = l_variable;
Which among the Above will Perform well ..........

C:\Documents and Settings\Girish Sharma>sqlplus
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Aug 19 15:52:28 2009
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
Enter user-name: scott/tiger
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> set autotrace traceonly statistics;
SQL> select ename from emp where upper(ename)='JAMES';
Statistics
          1  recursive calls
          0  db block gets
          8  consistent gets
          0  physical reads
          0  redo size
        411  bytes sent via SQL*Net to client
        381  bytes received via SQL*Net from client
          2  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
          1  rows processed
SQL> exitRelogin:
C:\Documents and Settings\Girish Sharma>sqlplus
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Aug 19 15:54:31 2009
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
Enter user-name: scott/tiger
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> set autotrace traceonly statistics;
SQL> VARIABLE INPUT VARCHAR2(50);
SQL> EXEC :INPUT := 'james';
PL/SQL procedure successfully completed.
SQL> select ename from emp where upper(ename)=upper(:input);
Statistics
          0  recursive calls
          0  db block gets
          8  consistent gets
          0  physical reads
          0  redo size
        411  bytes sent via SQL*Net to client
        381  bytes received via SQL*Net from client
          2  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
          1  rows processedOnly one difference in recursive calls, so it means both are almost same.
Girish Sharma

Similar Messages

  • Difference between copy value and use one as many

    hi
    what  is the difference between copy value and use one as many?
    thanks

    [http://help.sap.com/saphelp_nw2004s/helpdata/en/26/d22366565be0449d7b3cc26b1bab10/content.htm]
    [http://help.sap.com/saphelp_nw2004s/helpdata/en/ef/df564b6aa24fc9ab0d685460747de5/content.htm]
    Much better understanding of UseOneAsMany: [http://help.sap.com/saphelp_nw2004s/helpdata/en/38/85b142fa26c811e10000000a1550b0/content.htm]
    Edited by: Praveen Gujjeti on Feb 18, 2010 11:42 AM

  • Difference between copying cube content using datamarts and direct copying

    Hi Experts,
    I have been going through the SDN for the last 6 months  and this is my first post
    I know two methods of copying the cube content from one cube to another.
    One is data mart method in which we create a datasource based on the cube and
    then create a transformation between the new cube and datasource.
    This method is used if our source cube is in same server or in diff server.
    Other method is directly copying the cube content from source to destination
    by creating a transformation between two cubes .
    this is used if source cube anddestc u be are in same server.
    My  doubt is if both the cubes are in same server then what is diff between first method
    and second method,
    Please clarify me

    Hi,
    Now Iam closing this thread with a conclusion .
    The question is what is the difference between copying cube
    content using datamarts and direct copying
    Also what are there any other methods to copy cube contents
    from one cube to another.
    The  diff bet using data marts and direct copying is
    In case of datamarts,ven if the source cube is changed in futute there is no effect on the target cube.
    In case of copying directly,whenever the source cube is changed,the transformation becomes inactive.
    so we have to activate the transformation again.
    ALso there are some other methods to copy cube contents fron one to other .
    But datamarts is sap standard one.
    Thankyo every one for giving answers
    Regards,
    Sundar

  • Difference between invoking a method using reflect.proxy and reflect.Method

    Could any one tell me the difference between invoking a method using reflection java.lang.reflect.Method and java.lang.reflect.Proxy
    using both the class, we can invoke a method at runtime
    1)
    Method mthd=cl.getMethod("methodName",parameterName);
    Integer output=(Integer)mthd.invoke(new RunMthdRef(),input);
    2)
    Proxy.newProxyInstance(super.getClass().getClassLoader(), new Class[] { adapter }, new SomeClass(this));
    Does anybody have any idea?

    The two idioms are fundamentally different. Using java.lang.reflect.Method is how we call a method on a class, using Proxy is how we intercept that method call. An exercise for you, to illustrate that they do not do the same thing: write a simple class with one method, then use java.lang.reflect.Method to invoke that method, and then use a Proxy to invoke that method

  • Difference between generating VO while creating EO and otherwise

    Hello All,
    I wanted to know - Is there any difference between
    creating a VO while creating an EO (i.e.by checking 'Generate Default View Object')
    and
    when If I create an EO first , then seperately create a VO for the same table used in EO; and then attach that EO to the VO . By attaching EO to VO, I mean, after creation of VO ; if we right click that VO to edit - the 'View Object Editor ' window opens. here, I select an EO through the 'Select Entity Objects for this View Object' window.
    My requirement was to create a page where I wanted to do search and create. In the create page, the employee id and date has to come automatically. When submit button is clicked, the record is to be saved .
    1st I tried through the second method. I got the search results and in the create page, the id&date came as expected but create wasnt successfull. No error or exception came but in the record that got inserted into database had only the id,date and who column values. The other columns had null value.
    Later, when I tried using the 2nd method i.e by using the 'Default VO generated', creation was successfull.
    Could anybody tell me why it wasnt working the second way?

    user605260 ,
    There is no difference between creating a VO while creating an EO (i.e.by checking 'Generate Default View Object') and create an EO first , and then seperately creating VO . The latter is used if u haven't planned to make which VO or haven't finalised VO query.
    In ur case it looks the first time some mapping in VO might have not created correctly in any one case!
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • What is the difference between 'command delete' and using 'delete original and all versions'?

    My masters are not referenced and I usually have only one version.  What is the difference between using 'command delete' versus going to the top menu bar and using 'dele

    Good question  .
    When the Version is the only Version based on the Original of that Version, the two commands have the same effect.
    See this User Tip by master Aperturist Frank Caggiano.

  • Any change between 2003 & 2008 while using User Placeholder (%username%)

    Hi Experts,
    I just want to know if there is any change while using place holder (%username%) between 2003 & 2008R2.
    Vipin Tyagi

    I agree, and I still use it.
    Ace Fekay
    MVP, MCT, MCSE 2012, MCITP EA & MCTS Windows 2008/R2, Exchange 2013, 2010 EA & 2007, MCSE & MCSA 2003/2000, MCSA Messaging 2003
    Microsoft Certified Trainer
    Microsoft MVP - Directory Services
    Complete List of Technical Blogs: http://www.delawarecountycomputerconsulting.com/technicalblogs.php
    This posting is provided AS-IS with no warranties or guarantees and confers no rights.

  • Difference between the queries - help needed.

    I have three tables Plan_Zip,Service_Zip,Plan_Info
    Plan_Zip is the parent table and referenced by Service_Zip
    and Service_Zip is referenced by Plan_Info.
    I have this query:
    select
         sz.ts_nbr,pz.packages_qty,pz.stops_qty
    from
         plan_zip pz, service_zip sz, plan_info pi
    where
         pi.plan_run_nbr = sz.plan_run_nbr and
         sz.service_run_nbr = pz.service_run_nbr and     
         pi.day_plan_nbr = 43027 and
         pi.run_type_nbr = 0 and
         sz.ts_nbr = 1 or sz.ts_nbr = 2
    When I am running the query I am getting so many rows which are identical,
    but when I modified the above query as:
    select
         sz.ts_nbr,pz.packages_qty,pz.stops_qty
    from
         plan_zip pz, service_zip sz, plan_info pi
    where
         pi.plan_run_nbr = sz.plan_run_nbr and
         sz.service_run_nbr = pz.service_run_nbr and     
         pi.day_plan_nbr = 43027 and
         pi.run_type_nbr = 0 and
         (sz.ts_nbr = 1 or sz.ts_nbr = 2)
    I am getting the correct results.
    Please explain me the difference between the above two queries.
    Regards
    Raghu

    Look at the below example
    SQL> create table t
      2  as
      3  select level no, level no1, 0 no2
      4    from dual
      5  connect by level <= 5
      6  /
    Table created.
    SQL> select * from t
      2  /
            NO        NO1        NO2
             1          1          0
             2          2          0
             3          3          0
             4          4          0
             5          5          0
    SQL> select *
      2    from t
      3   where no = 1
      4     and no1 = 1
      5      or no2 = 0
      6  /
            NO        NO1        NO2
             1          1          0
             2          2          0
             3          3          0
             4          4          0
             5          5          0Here what the where condition is telling is no should be 1, no1 should be 1 or no2 is 0. you can read it like this.
    if (no = 1 and no1 = 1) or (no2 = 0)
    then
         true ;
    else
         false;
    end if;so what i does is no2 = 0 is satisfied by all the rows and hence all the rows are returned.
    Next...
    SQL> select *
      2    from t
      3   where no = 1
      4     and (no1 = 1 or no2 = 0)
      5  /
            NO        NO1        NO2
             1          1          0This can be read like this.
    if (no = 1) and (no1 = 1 or no2 = 0)
    then
         true ;
    else
         false;
    end if;Here no = 1 is a must satisfy condition. Once that is satisfied then no1 can be 1 or no2 can be 0 which ever is
    satisfied consider that. So the first condition no=1 is satisfied by only one record and hence that alone is returned.
    Thanks,
    Karthick.

  • Difference between Child DC and used Component

    Hi,
    what is the difference between a child DC or when I use another DC via Interface?
    Best regards,
    Peter

    Ah okay, so a Child DC is only in the parent DC and can not be reused from other DC's.
    Thanks.
    Best regards,
    Peter

  • Switching between multiple desktops while using VNC

    Hi All,
    Encountering a minor inconvenience with switching between desktops while VNC-ing. I frequently telecommute and VNC into my work imac, which has parallels + windows 7 installed. My personal machine is a retina macbook pro, and both my macbook and the imac have the newest mavericks installed. I will frequently have multiple desktops open on my imac, but I find that when I am VNC-ing into the imac and then open up parallels in a full window that I am then unable to switch back to my other OS X desktops unless I completely shutdown my windows VM. Normally hotkeys works for me to switch between desktops (and still works when switching from OS X window to OS X window), but it just doesn't do the trick here. I know could just configure my imac so that parallels doesn't open up in full screen mode, which would solve the issue, but I feel like there's gotta be a way to switch desktops while VNC-ing! All tips appreciated!
    Thanks,
    KP

    Hi,
    This is possible using access restrictions in Universe designer based on user login.
    For eg. there is user A,B and C and three connections C1,C2 and C3.
    In Manage access restrictions you have to create a three restrictions(R1,R2 and R3): one using C1,second C2 and third C3.
    Apply these three restrictions to corresponding to the users. i.e. R1-->A,R2-->B and R3-->C.
    So based on user login the instance will be used for same report.
    In IDT , I think this can be done using Data Level Security, but the concept wil be same.
    Thanks
    Gaurav

  • I have two ipads under the same name/account. How do I airplay content from one to the other if there is not a distinguishing difference between the two or use face chat?

    I gave my 2yr old my 16gb ipad 2 when I upgraded to a 64gb ipad 3. They are on the same account so that I can share certain apps between them, but because they consider themselves one in the same I can't use airplay or face chat with my daughters ipad. How do I do these things?

    Airplay doesn't work between two iPads so you don't need to worry about that, however, you can change the name of an iPad in Settings > General > About > Name.

  • Difference between two queries for no client installed

    I have created a collection for all discovered computers with no client installed using the following query:
    select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System where SMS_R_System.Client is null
    If I go to Monitoring -> Client Status -> Client Activity and click on the link next to the pie chart for no clients installed I get a completely different result and they neither query contains the same computers as each other.
    Anyone know what the exact query the link in the monitoring section is using and why the results between the two are completely different?
    If would expect them to match up or at the very least that my first query should be the source of truth.

    If I use:
    select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System where SMS_R_System.Client is null OR SMS_R_System.Client = 0
    and use the same limiting collection as the built in monitoring query  "All Desktop and Server Clients" I actually get 0 results from the query.  If I use "All Systems" as the limiting collection I still only get the same results
    that I do with out also querying for "equals 0" as well.
    I read one article that said that "equals 0" actually shows you the clients had the CCM client but it was uninstalled where "is Null" returns systems that never had the CCM client.
    I don't know if this is accurate but it doesn't explain why a built in monitoring query would return inaccurate results.  It only returns a fraction of the non-client systems that the above query returns and as mentioned, the systems returned in one
    are not included in the other.

  • Difference Between MBRL and Rejection using QA11

    ALL SAP GURUS
    I want to reject the material.
    When I reject (movt type 122) using MBRL, MIGO doc type is WE
    and When rejected using T code QA11 doc type is WQ
    Why this difference, although in both cases same thing we r doing.
    Please give ur valuable suggestions.
    Regards,

    Hi Rajan,
    I have given the siolution for this to you in your previous post.
    You can maintain same document type for MBRL as well as for QA11.
    goto SM30, Give Table/Viewv - V_158, click on maintain.
    Now for MBRL Transaction maintain the Document type as WQ & for QA11 give the doucmnet type WQ
    Thanks & reagrds
    Kishore

  • Difference between these queries

    Hi,
    I have two tables table1 and table2. Both have a common column say for ex. col1
    I tried to find the rows in table1 where there is no corresponding value for col1.
    My query is
    Select * from table1 a where a.col1 not in (select b.col1 from table2 b);
    This returned me nothing.
    But when my co-worker executed a query like this
    select a.col1 from table1 a
    minus
    select b.col1 from table2 b;
    This gave us the results. How is both of them different and how to know where to use what?

    Hi,
    where   a.col1 not in (select b.col1 from table2 b);will never evaluate to TRUE if there are NULLs in table2.col1.
    Remember that SQL uses three-valued logic.
    Expressions such as x IN (y) can be TRUE, FALSE, or UNKNOWN.
    Since x = NULL is UNKNOWN (even if x itself IS NULL), then x IN (y), where y is a list or a sub-query, will be either TRUE or UNKNOWN if y contains NULL.
    So x NOT IN (y) will be either FALSE or UNKNOWN (if y contains NULL).
    To be practical, NOT IN sub-queries usually need to guarantee that they will not return NULL rows, e.g.
    WHERE   a.col1 NOT IN
            SELECT  col1
            FROM    table2
            WHERE   col1 IS NOT NULL
            )Repeat: this applies only to NOT IN sub-queries.
    IN sub-queries behave the way most people find intuitive.

  • Outer join: difference between two queries

    Below two queries that should give the same results in my opinion. I want all the records from u_protocol and only the value of pval.u_protocol_variable_value if present.
    Why does the outer join in query2 doesn't work like in query1?
    Query1:
    select p.u_protocol_id, i.u_protocol_variable_value
    from lims_sys.u_protocol p,
       select pval.u_protocol_id, pval.u_protocol_variable_value
       from lims_sys.u_protocol_variable pvar, lims_sys.u_protocol_value_user pval
       where pvar.u_protocol_variable_id = pval.u_protocol_variable_id
       and pvar.name = 'VALUE_Protocol_Group'
    ) i  
    where p.u_protocol_id  = i.u_protocol_id (+)
    Query2:
    select prt.u_protocol_id, pval.u_protocol_variable_value
    from lims_sys.u_protocol prt, lims_sys.u_protocol_variable pvar, lims_sys.u_protocol_value_user pval
    where pvar.u_protocol_variable_id = pval.u_protocol_variable_id
    and prt.u_protocol_id = pval.u_protocol_id (+)
    and pvar.name = 'VALUE_Protocol_Group'

    In the first query restriction pvar.name = 'VALUE_Protocol_Group' is limited to your inline view. So when you do a outer join with the u_protocol table you will get the number of records which are there in the u_protocol table.
    But when you gave the restriction pvar.name = 'VALUE_Protocol_Group' outside the inline view, the restriction was based on the resultset as a whole. So you will get only those records which have pvar.name = 'VALUE_Protocol_Group' condition satisfied.
    Hope the following illustration helps:
    SQL> CREATE TABLE TEST_TAB
      2  AS
      3  SELECT level col_1, chr(65+level-1) col_2 FROM Dual
      4  CONNECT BY LEVEL <= 10
      5  /
    Table created.
    SQL> SELECT * FROM TEST_TAB
      2  /
         COL_1 COL_
             1 A
             2 B
             3 C
             4 D
             5 E
             6 F
             7 G
             8 H
             9 I
            10 J
    10 rows selected.
    SQL> CREATE TABLE TEST_TAB_B
      2  AS
      3  SELECT level col_3, chr(65+level-1) col_4 FROM Dual
      4  WHERE Level NOT IN (2,3,4)
      5  CONNECT BY LEVEL <= 10
      6  /
    Table created.
    SQL> SELECT * FROM TEST_TAB_B
      2  /
         COL_3 COL_
             1 A
             5 E
             6 F
             7 G
             8 H
             9 I
            10 J
    7 rows selected.
    SQL> SELECT a1.col_1, a1.col_2, a2.col_3, a2.col_4 FROM TEST_TAB a1,
      2  TEST_TAB_B a2
      3  where a1.col_1 = a2.col_3(+)
      4  order by a1.col_1
      5  /
         COL_1 COL_      COL_3 COL_
             1 A             1 A
             2 B
             3 C
             4 D
             5 E             5 E
             6 F             6 F
             7 G             7 G
             8 H             8 H
             9 I             9 I
            10 J            10 J
    10 rows selected.Notice the output without any extra conditions: You will get all the values from TEST_TAB and matching records from TEST_TAB_B. Non-matching records are outputed as NULL.
    Following Query is resemblence to your first query
    SQL> SELECT a1.col_1, a1.col_2, a2.col_3, a2.col_4 FROM TEST_TAB a1,
      2  (SELECT * FROM TEST_TAB_B where col_4='A') a2
      3  where a1.col_1 = a2.col_3(+)
      4  order by a1.col_1
      5  /
         COL_1 COL_      COL_3 COL_
             1 A             1 A
             2 B
             3 C
             4 D
             5 E
             6 F
             7 G
             8 H
             9 I
            10 J
    10 rows selected.Here TEST_TAB_B Table is restricted with a condition which will restrict the inline view to have only one record. So when you outer join the inline view you will get output as shown above.
    The following query resembles to your second query.
    SQL> SELECT a1.col_1, a1.col_2, a2.col_3, a2.col_4 FROM TEST_TAB a1,
      2  TEST_TAB_B a2
      3  where a1.col_1 = a2.col_3(+)
      4  and a2.col_4 = 'A'
      5  order by a1.col_1
      6  /
         COL_1 COL_      COL_3 COL_
             1 A             1 A
    1 row selected.
    SQL> DROP TABLE TEST_TAB_B
      2  /
    Table dropped.
    SQL> DROP TABLE TEST_TAB
      2  /
    Table dropped.
    SQL> To understand this lets break up the resultset.
    Resultset brought by join condition would be something like :
        COL_1 COL_      COL_3 COL_
             1 A             1 A
             2 B
             3 C
             4 D
             5 E             5 E
             6 F             6 F
             7 G             7 G
             8 H             8 H
             9 I             9 I
            10 J            10 JAgreed?
    Now when you add the extra condition a2.col_4 = 'A' thecondition will act upon the above resultset there by restricting the records to:
         COL_1 COL_      COL_3 COL_
             1 A             1 AHope this helps.
    Regards,
    Jo

Maybe you are looking for

  • A Standard RRB report that shows actual project cost line items .... ?

    A Standard RRB report that shows actual project cost line items but that also shows amount/qty by rejected, billed, to be billed, postponed? I'm looking for something that will allow project managers to reconciile with the RRB totals and be able to d

  • Transfer attachments and Digital Signatures,from a PDF, to Interactive Form

    Hi, I am developing an an application in WebDynpro Java. I have a requirement that a user A creates a new interactive form & fills some of the details, & then saves the form. User B then fetches the form & fills the remaining details. User A can add

  • System.in

    I have a small problem. in this: // SquareTest.java // Uses the Square class to read in square data and tell if // each square is magic. import cs1.Keyboard; public class SquareTest public static void main(String[] args)      System.setIn( new FileIn

  • Emac Display Expanding and Contracting

    I have a first generation Emac that I just bought used. The screen is expanding and contracting (left - right). Any suggestions on what this is? Thanks.

  • New type of order

    Hi, I want to create new (from copy of existing type) type of order. I  will create new order in ME21 with new type which I create. There is some stuff in forum - f.e. information that I can do it in SPRO: "PM/CS>Maintenance and service processing>Ma