Alternate for 'IN' operator

All,
version: 11g
One of my query which uses 'IN' operator in WHERE clause to filter. I used around 30 values inside the IN operator to filter. I'm facing performance issue with this, Is there any alternate to IN operator which improves the performance of the query? For some reason, I don't want to go for UNION set operator. Pls advise.
thanks
sen

SELECT Approvable, Approvable."Type", Approvable.UniqueName, Approvable.Name, Approvable.CreateDate, Approvable.StatusString FROM Approvable WHERE Approvable."Active" = TRUE
AND Approvable.Preparer = baseid('AAAKAECCxTV') AND
Approvable."Type" <> 'txt.common.core.SupplierProfileRequest' AND Approvable."Type" <> 'txt.receiving.core.Receipt' AND Approvable."Type" <> 'txt.receiving.core.MilestoneTracker'
AND Approvable."Type" <> 'txt.contract.core.Contract'
AND Approvable."Type" <> 'txt.invoicing.core.InvoiceReconciliation' AND Approvable."Type" <> 'txt.payment.core.Payment' AND Approvable."Type" <> 'txt.payment.core.PaymentTransaction'
AND Approvable."Type" <> 'txt.purchasing.core.PurchaseOrder'
AND Approvable."Type" <> 'txt.purchasing.core.CopyOrder' AND Approvable."Type" <> 'txt.purchasing.core.DirectOrder' AND Approvable."Type" <> 'txt.purchasing.core.ERPOrder'
AND Approvable."Type" <> 'txt.pcard.core.PCardOrder' AND Approvable."Type" <> 'txt.charge.core.ChargeReconciliation' AND Approvable."Type" <> 'txt.charge.core.Charge'
AND Approvable."Type" <> 'txt.collaboration.core.Proposal' AND Approvable."Type" <> 'txt.collaboration.core.CounterProposal' AND Approvable."Type" <> 'txt.collaboration.core.CollaborationRequest'
AND Approvable."Type" <> 'txt.expense.core.TravelAuthorizationOrder' AND Approvable."Type" <> 'txt.budget.core.Budget' ORDER BY Approvable.TimeCreated DESC*Is the above more readable than below?
SELECT approvable,
  approvable."Type",
  approvable.uniquename,
  approvable.name,
  approvable.createdate,
  approvable.statusstring
FROM approvable
WHERE approvable."Active" = true
AND approvable.preparer   = baseid('AAAKAECCxTV')
AND Approvable."Type"    != 'txt.common.core.SupplierProfileRequest'
AND Approvable."Type"    != 'txt.receiving.core.Receipt'
AND Approvable."Type"    != 'txt.receiving.core.MilestoneTracker'
AND Approvable."Type"    != 'txt.contract.core.Contract'
AND Approvable."Type"    != 'txt.invoicing.core.InvoiceReconciliation'
AND Approvable."Type"    != 'txt.payment.core.Payment'
AND Approvable."Type"    != 'txt.payment.core.PaymentTransaction'
AND Approvable."Type"    != 'txt.purchasing.core.PurchaseOrder'
AND Approvable."Type"    != 'txt.purchasing.core.CopyOrder'
AND Approvable."Type"    != 'txt.purchasing.core.DirectOrder'
AND Approvable."Type"    != 'txt.purchasing.core.ERPOrder'
AND Approvable."Type"    != 'txt.pcard.core.PCardOrder'
AND Approvable."Type"    != 'txt.charge.core.ChargeReconciliation'
AND Approvable."Type"    != 'txt.charge.core.Charge'
AND Approvable."Type"    != 'txt.collaboration.core.Proposal'
AND Approvable."Type"    != 'txt.collaboration.core.CounterProposal'
AND Approvable."Type"    != 'txt.collaboration.core.CollaborationRequest'
AND Approvable."Type"    != 'txt.expense.core.TravelAuthorizationOrder'
AND Approvable."Type"    != 'txt.budget.core.Budget'
ORDER BY Approvable.TimeCreated DESCIf only, you could maintain a Master/Reference table, that stores the "Approvable.TYPE" values that are valid, the entire query can be reduced to below:
SELECT approvable,
  approvable."Type",
  approvable.uniquename,
  approvable.name,
  approvable.createdate,
  approvable.statusstring
FROM approvable
WHERE approvable."Active" = true
and approvable.preparer   = baseid('AAAKAECCxTV')
and not exists (
                select 'x'
                  from reference_type_table r
                 where r.type = approvable.type
ORDER BY Approvable.TimeCreated DESCAnd nowhere have you used an IN operator, which contradicts with your subject line. So, unless you want to confuse others, the subject line must depict the picture of your problem.
As you may have noticed, the Forum software replaced Not Equals sign with a Blank, you must use != as the Not Equality operator.
Moreover, what you write in IN List, oracle converts it to OR-ed conditions. See below:
explain plan for
select * from dual where trunc(sysdate) in (to_date('07-Jan-2012', 'DD-Mon-YYYY'), to_date('08-Jan-2012', 'DD-Mon-YYYY'));
Plan hash value: 1224005312
| Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     |
|   0 | SELECT STATEMENT   |      |     1 |     2 |     2   (0)| 00:00:01 |
|*  1 |  FILTER            |      |       |       |            |          |
|   2 |   TABLE ACCESS FULL| DUAL |     1 |     2 |     2   (0)| 00:00:01 |
Query Block Name / Object Alias (identified by operation id):
   1 - SEL$1
   2 - SEL$1 / DUAL@SEL$1
Predicate Information (identified by operation id):
   1 - filter(TRUNC(SYSDATE@!)=TO_DATE(' 2012-01-07 00:00:00',
              'syyyy-mm-dd hh24:mi:ss') OR TRUNC(SYSDATE@!)=TO_DATE(' 2012-01-08
              00:00:00', 'syyyy-mm-dd hh24:mi:ss'))
Column Projection Information (identified by operation id):
   1 - "DUAL"."DUMMY"[VARCHAR2,1]
   2 - "DUAL"."DUMMY"[VARCHAR2,1]Hence, I do not believe that changing to or from IN operator will benefit the performance, unless you are writing the query that makes better use of Indexes. If you have performance issues with your query, then I would suggest you to read {message:id=3292438} and provide proper information.
Edited by: Purvesh K on Jan 7, 2013 6:07 PM
Added Explain Plan

Similar Messages

  • PP - Actual time taken for an operation - seperate entry

    Hello
    We are on ECC 6.0
    Whether there is alternate way available in SAP which enable us to enter separately the actual time taken by technical labour, non-technical labour and various machine for a particular operation in a process order (currently actual time for the operation as whole is entered) 
    pls. guide us.
    Thanks.

    I am not sure but you can have different activity types for different labour and enter the time in that.  We had proposed this to one of our clients but he said he didnt want it to be so complicated.
    Regards
    Yatin Thakkar

  • IPod Classic 80GB - "iTunes library cannot be saved you do not have enough access privileges for this operation" It says it has synced but it hasn't. Help please I am not very tech minded

    iPod Classic 80GB. Message reads ' iTunes library cannot be saved you do not have enough access privileges for this operation'.  It says it has synced but it hasn't. Please help, I am not very tech minded.

    See this article about troubleshooting the error message regarding access privelages.  It may be preventing your iTunes library from being able to save/retain music you have recently imported to it, which may explain why no new content is being added to your device.
    Trouble adding music to iTunes library or importing audio CD
    B-rock

  • What does this message mean, "The iPad cannot be synced.  You do not have enough access privileges for this operation?"

    I need some help syncing my iPad.  I get a message about not having enough privileges for this operation.  Any help would be appreciated.
    Thanks,

    It means you are using windows and the user agent stuff is messed up.
    Try looking at permissions on the drive iTunes library is on.

  • Problem in Wfetch client for Update operations

    Hi,
    I am using the Wfetch client for the 'Update' operation of an RFC Gateway consumption model . But it seems to always give this error : 'HTTP/1.0 400 Bad Request\r\n'
    I have passed only those fields that have been exposed in the GW Data model. Is there anything else that needs to be taken care of ?
    The read and query operations are executed successfully though.
    Thanks,
    Shubhada

    Hi Shubhada,
    Just recheck two things in Wfetch with below details.
    1. Check the path. It should be below formate for update operation
    Verb : Put
    Path:  /sap/opu/sdata/sap/<CONSUM_MODEL>/<data_model>Collection(value='  ',scheme_id='<DATA_MODEL>',scheme_agency_id='  ')?sap-client=< >&$format=xml
    Above formate you can take from Read operation which you already executed successfully.
    2. Check the XML formate on right handside in Wfetch it should be header & body with below details.
    Xml Formate:
    x-requested-with: XMLHttpRequest\r\n
    \r\n
    <?xml version="1.0" encoding="utf-8" standalone="yes"?>\r\n
      <entry xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">\r\n
          <content type="application/xml">\r\n
            <m:properties>\r\n
       <d:value> </d:value> \r\n
      <d:scheme_id> </d:scheme_id> \r\n
      <d:scheme_agency_id> </d:scheme_agency_id> \r\n
    Just copy from read operation Read operation which you already executed successfully. And update the fields what you required.
    </m:properties>\r\n
          </content>\r\n
    </entry>\r\n
    Hope you this will help above information.
    Thanks & Regards,
    Mahesh Devershetty

  • HT1386 I get an error message when I try to sync my iPod touch - "you do not have enough access privileges for this operation"

    I recently installed a new hard drive on my PC, downloaded iTunes, updated the software on my iPod touch and now I get this error message when I try to sync:  "you do not have enough access privileges for this operation."  It never did this before, whether it's the upgrade in software or something in iTunes, but it's very frustrating, since I'd like to add more things to my iPod.

    See:
    iPhone - not enough access privileges: Apple Support Communities

  • How do i resolve my itunes from saying " The itunes application could not be opened. You do not have enough access privileges for this operation."

    Everytime i click to go to my itunes, the message "The Itunes application could not be opened. You do not have enough access privileges for this operation." pops up. I have tried my best to fix it by adding another account to my computer and setting that one as the administator and mine as the regular user. When i did that the itunes worked on both, but when i changed my account back to administator and the other account to the regular user my account didnt work but the other one did. I also tried to uninstall and reinstall itunes. This message popped up when i tried to update the itunes to the newest one. And still it wont go away. Can someone help me please. Thanks!

    Are you logged in with administrative rights? Did you check your security software settings? Troubleshooting security software issues

  • Single concurrent program for multiple operating units

    HI
    I am working on XML/BI publisher to generate AR invoice reports.
    We have single rdf report using which rtf templates are generated.
    There are 10 operating units (10 ORG_ID's) and 10 rtf templates, one for each operating unit. There are 4 different responsibilities for each ORG_ID
    Eg: ORG_ID's = 11, 12, 13, 14..........etc
    Eg: Responsibility = xx, yy, zz...........etc
    I want to register a single concurrent program. When a user submits a request from "XX" responsibility, then the template associated with that org_id should be generated. Whichever responsibility the user is accessing from, that particular template must be shown as output.
    How can i register one concurrent program for multiple operating units.
    Thanks!
    Edited by: 994628 on Mar 18, 2013 4:39 PM
    Edited by: 994628 on Mar 18, 2013 4:42 PM

    >
    There are 10 operating units (10 ORG_ID's) and 10 rtf templates, one for each operating unit. There are 4 different responsibilities for each ORG_ID
    Eg: ORG_ID's = 11, 12, 13, 14..........etc
    Eg: Responsibility = xx, yy, zz...........etc
    I want to register a single concurrent program. When a user submits a request from "XX" responsibility, then the template associated with that org_id should be generated. Whichever responsibility the user is accessing from, that particular template must be shown as output.
    >
    interesting case for 10 OE set 10 template
    what is purpose? for each OE different requirements for layout?
    BTW
    if each Responsibility associated with one org_id then
    - you can get current org_id when you run concurrent program
    - create main template (will be #11) with condition like
    <?choose:?>
    <?when: ORG_ID=11?>
    <?import:xdo://FND.XX11_SUB.en.00/?>
    <?call:TEMPLATE11?>
    <?end when?>
    <?when: ORG_ID=12?>
    <?import:xdo://FND.XX12_SUB.en.00/?>
    <?call:TEMPLATE12?>
    <?end when?>
    <?otherwise:?>
    <?import:xdo://FND.XX21_SUB.en.00/?>
    <?call:TEMPLATE21?>
    <?end otherwise?>
    <?end choose?>so based on org_id will be import of needed subtemplate
    - re-register your "10 rtf templates" as subtemplates
    another way is substitution of template for concurrent then it running
    in before_report trigger set needed template
    l_conc_request_id := fnd_global.conc_request_id;
        if ORG_ID = 11 then
          UPDATE fnd_conc_pp_actions t
             SET t.argument2 = 'XX11'
           where t.concurrent_request_id = l_conc_request_id
             and t.action_type = 6;
      if ORG_ID = 21 then
          UPDATE fnd_conc_pp_actions t
             SET t.argument2 = 'XX21'
           where t.concurrent_request_id = l_conc_request_id
             and t.action_type = 6;

  • I can't synchronize my iPod's with my iTunes software (Windows Vista Home Premium) due to problems with the access authorization / rights for this operation

    Hi there,
    I'd like to ask you something:
    I'm trying to synchronize all my iPod's (I have as many as 4 iPods: 2 iPod touch a 8 GB each and 2 iPod classic a 160 GB each) with my iTunes software (Version 11.3.1 which is installed on a Windows PC (Windows Vista Home Premium)). Unfortunately, the iTunes software refuses to run the command "synchronize with the iPod connected" regarding each and every iPod I have. iTunes just declares:
    Synchronizing is impossible because I wouldn't hold the access authorization / rights for this operation.
    I uploaded the songs at issue to my iTunes folder from CD's (all songs are in AAC format now).
    What is this access authorization, why was something like that invented and what can I do to get it?
    How do I have to proceed in detail?
    What would it cost?
    I am brand new here and have never ever made a post in any support community anywhere in the world in my life. Well, and I am not excessively knowledgeable about the particular computer or mac language but I know the very basics or can find out about them.
    Anyways - can you help me please?
    If you can't help me, who can do so?
    It would be nice if you could answer me as soon as possible!
    Thank you guys
    Prying Pedro

    Yes, others have experienced the problem, a simple search of the forums would have revealed that and the simple solution.
    Termporarily disable any security software on the computer.

  • I have a new PC and I am getting the message "The iTunes Library File cannot be saved.  You do not have enough access privileges for this operation."  I am the only one using this PC and I have Windows 7 Pro and have an administrator account.  Help

    Can anyone help me with this problem.  ITunes message," The iTunes library file cannot be saved.  You do not have enough access privileges for this operation."   I have administrator account and transferred files from old PC.  I downloaded new iTunes program on new PC.  I synced my iPhone to new PC, no problem.  I deleted old account after indicating shared files to new admin account.  Can anyone help?

    A belated reply, as the problems itunes has have discouraged me from using it much. If you uncheck the "read only" box, it doesn't stay that way! Next time you use it, the box comes up checked.
    I'm still having that problem, even when I open iTunes as administrator.
    I've yet to see the answer to this problem. I use itunes mostly to download audiobooks, and I'm ready to download more, and want to save them!

  • I keep getting dialog box saying " The itunes Library file cannot be saved. You do not have enough access privileges for this operation"  I am the only user on this computer and only one library! how do i change access privileges please?

    hi I keep getting the dialog box " The iTunes Library file cannot be saved. You do not have enough access privileges for this operation"
    How do i  amend this  as i only have one account and one library. I cannot save new work or delete duplicate files

    A belated reply, as the problems itunes has have discouraged me from using it much. If you uncheck the "read only" box, it doesn't stay that way! Next time you use it, the box comes up checked.
    I'm still having that problem, even when I open iTunes as administrator.
    I've yet to see the answer to this problem. I use itunes mostly to download audiobooks, and I'm ready to download more, and want to save them!

  • When I try to sync my ipad using itunes I get the following message. This iPad cannot be synced. You do not have enough access privileges for this operation. Any ideas how this can be resolved?

    When I try to sync my ipad using itunes I get the following message. This iPad cannot be synced. You do not have enough access privileges for this operation. Any ideas how this can be resolved?

    See if the user tip helps: https://discussions.apple.com/docs/DOC-6562

  • Getting " Not enough memory for the operation error " in BOE

    Hi,
    We are using BOE 11.0.
    we try to schedule a new report with multiple database logins for testing in BOE. When we run the report we are getting error like "Not enough memory for the operation error"
    The same report has been executed successfully when we run using Crystal reports developer. The report is fectching less than 10K records from all the databases together.
    Please let me know which is causing the issue and also let me know is there any limit in the number of databases connecting for a single report.
    many thanks in advance for all your help.
    Cheers,
    Suri ;-)

    Hi Sarthan,
    Sorry. I'm new to BOE. We know only scheduling the reports creating folders etc. :-)
    I've seen one parameter "Maximum Cache Size Allowed (KBytes)" and the value for this parameter is 5000.
    If we change it to a big number whether we can solve the issue ? Please suggest.
    Cheers,
    Suri ;-)

  • Overflow for arithmetical operation (type P) in program.

    Hi experts..
    I had developed a report for showing total receipt and issues and confirmed issue.
    of PQ.
    For all the plant is running fine but only for one plant 2050 its going into dump and error is "Overflow for arithmetical operation (type P) in program." and the code line is
    T_EKET-MNG02 = T_EKET-MNG02 * ( t_mdbs-umrez / t_mdbs-umren ).
    MNG02 IS OF TYPE  Data : "Quan", length =13 , decimal = 3.
    initially : value in Mng02 is =  10       and ratio is 11/8 = 1.375
                  and in the debugging the value is   10*1.375 = 13.75
    but... when i am executing it .. its going into dump and after again checking the MNG02 is showing valude --9765133613.881  and the above error.
    what should i do....
    please help..
    i will award the points for every help...
    thanks

    Hi,
    Are you doing any other calculation for field MNG02 in your program?
    I created a small program with the field and values you have mentioned and it gave me the result 13.75 and no short dump.
    Please check following things:
    When short dump occurs, it shows at which line it has occured. Is it showing that the shortdump has occurs on the line you are talking about here or it is somewhere else.
    Also, when shortdump occurs, it shows a "debugging" button at the top. Hit that button and it will show you exactly where the short dump has occured. What ever this statement is, check what are the values of different variables here.
    Check all these and you might get the answer. Let me know if you still have problem.
    Regards,
    RS

  • Get error message when syching iPod, iPod cannot be synced. You do not have enough access priveleges for this operation.  How to solve this?

    Get error message when syching iPod, iPod cannot be synced. You do not have enough access priveleges for this operation.  How to solve this?

    Hello FranBNYC
    It sounds like a permissions issue with your library, check out the article below to check and make sure that things are set correctly.
    Trouble adding music to iTunes library or importing audio CD
    http://support.apple.com/kb/ts1387
    Thanks for using Apple Support Communities.
    Regards,
    -Norm G.

Maybe you are looking for

  • My Ipod touch dosen't show up on my laptop or itunes

    Around 2 days ago it showed up and i plugged it into my brother's computer and it also showed up. i tried trouble shooting it and still nothing. somethign similar has also happened when my ipod wouldn't turn on after i thought i charged it. my dad wa

  • 9/10/2013 - AIR 3.9.0.790 Runtime and SDK Beta

    Adobe AIR Beta Channel Update This beta release provides access to the latest AIR runtime and SDK (with compiler) for Windows, Mac OS, iOS and Android. Below are some of the key features and benefits of AIR 3.9.  Please see our release notes for full

  • Handling Unit with packaging Material

    Hi All Can someody plz tell me WM process. Plz go through my scenario: I want to transfer the material from one site to another site through STO. I create an STO(ME21N) -> Delivery (VL10D) -> Handling Unit(HU02) -> Outbound Delivery of HU(VLMOVE) ->

  • Image playback on TV monitor problem

    Right, my DVD is made up of still images (300 dpi, RGB, JPGs) and when the DVD is played on a TV two of the images seem to "dance" on the screen. One has a pan across the image applied and the other is still with no effects. I tried the de-interlace

  • Online number disconnected / not avaliable

    For the last 3 days when dialing our number it says number disconnected or unavalible. As a backup we tried to setup forwarding though the account settings page - this also does not work. any help ?