Using NOT IN operator

For the life of me I can't remember how to do this. I have a
query:
SELECT username
FROM ecae
WHERE username NOT IN (#listsent#)
where
#listsent# is a comma delimited list. I know in these cases
I need to wrap each entry in the list in single quotes, but I
forgot how. I remember readinf years ago about needing to use one
of the string manipulation functions to get this to work. Does
anyone remember how this is done?

Never mind. I found the answer; ListQualify()

Similar Messages

  • Is it possible to use "not" logical operator in a Business Rule Condition?

    This seems like a very simple request to me, but I cannot see any other questions/answers about it.
    Can I add a "not" to my Conditions in a Business Rule?
    My scenario is that I have a core Entity with a Type.  The Type is a domain attribute with a Code and Name.  The Code of the core Entity should in the form 'AA-9999', where 'AA' is the Code from Type.
    The idea is that I have a business rule with the condition "not
    Code starts with DBA.Type.Code" and the Action would be "Code is not valid".
    Is this possible?  Is there a better way of implementing this?
    Thanks,
    Michael

    Yeah! This is the board in question! But it has lots of versions, like K7T Pro, K7T Pro2 (my one!), K7T Turbo, K7T Turbo Limited Edition and K7T Turbo2, all of then are WS-6330 Lite...   They phisically diferent, but the BIOS seens to be the same... I want to know is this feature in the newer version is going to work or not on my board (MS 6330 Lite K7T Pro2 Ver:1) ....
    Doesn´t matter what board you choose (PRO, PRO2, Turbo, Turbo2) the MSI page shows all the same BIOS to Download... But I think that this feature is only applicable for K7T Turbo2, but will make no difference in my! At least that´s what I think...
    But you´re right! The board that I have is the one on the link you said!
    Thanks!      

  • Error message has just occurred... This copy of itunes is corrupted. Please reinstall itunes. I'm using a Macbook operating on version 10.6.8 - not that this means anything to me. I just want to preserve my library and playlists! What do I do?!

    Error message has just occurred... This copy of itunes is corrupted. Please reinstall itunes. I'm using a Macbook operating on version 10.6.8 - not that this means anything to me. I just want to preserve my library and playlists! What do I do?!

    Let's try a repair install of iTunes.
    Restart the PC first.
    If you're using Vista or 7, now head into your Uninstall a program control panel, select "iTunes" and then click "Repair".
    If you're using XP, head into your Add or Remove Programs control panel, select "iTunes", and click "Change". Select "Repair" and click "Next" as per the following screenshot:
    Can you launch your iTunes now?

  • How can I use free programs on my ipad2 model A1396?I do not know operating system.

    How I can  use free ipad programs on my ipad2? I do not know operating system.

    You can tell what version of iOS you have via Settings > General > About > Version
    If you are in Iraq then unfortunately you can't currently get any content, including apps, from Apple (and Apple is the only source for apps) as there isn't currently an iTunes store in your country. If/when that is likely to change I don't know.

  • ORA-13207: incorrect use of the [More than 2D not supported] operator

    Oracle 8.1.7.4:
    The same query works in an Oracle DB on Linux and Windows, but in a Solaris it gives me the following error:
    cc_redes_met_coaxial@ORAG2> SELECT lot_f.lot_id id,
    ROUND(MDSYS.SDO_GEOM.SDO_DISTANCE(lot_geom.geometry, ped_geom.geometry, 0.5),2) dist
    FROM lot_f,
    pedestal_f,
    G_GEOMETRY_0 lot_geom,
    2 G_GEOMETRY_0 ped_geom
    WHERE lot_f.feat_num = lot_geom.feat_num
    3 AND pedestal_f.acc_point_id = 611
    AND pedestal_f.feat_num = ped_geom.feat_num
    4 AND lot_f.g_version+0 = 0
    AND (lot_f.g_next_version > 0 OR lot_f.g_next_version IS NULL)
    5 AND pedestal_f.g_version+0 = 0
    6 AND (pedestal_f.g_next_version > 0 OR pedestal_f.g_next_version IS NULL)
    AND MDSYS.SDO_WITHIN_DISTANCE(lot_geom.geometry, ped_geom.geometry,'distance = 100' ) = 'TRUE';
    7 8 9 10 11 12 13 14 SELECT lot_f.lot_id id,
    ERROR at line 1:
    ORA-29902: error in executing ODCIIndexStart() routine
    ORA-13207: incorrect use of the [More than 2D not supported] operator
    ORA-06512: at "MDSYS.SDO_INDEX_METHOD", line 84
    ORA-06512: at line 1
    The data is in 3D. I took a look at the trace file but no useful information. It does not have to be 2d, right?
    I can use SDO_WITHIN_DISTANCE with data in 3d, can't I?
    Does anyone know what is going on? Maybe a bug?
    Regards,
    Alex

    Daniel,
    I created the spatial index in 2d, but if I collect stats on all tables the optimizer doesn't use the spatial index.
    I tried to influence the optimizer using hints, but it seems to ignore the hint clause. The query I did is above:
    SELECT /*+ INDEX(lot_geom G_GEOMETRY_0_SI) INDEX(ped_geom G_GEOMETRY_0_SI) */
         lot_f.lot_id id,
    ROUND(MDSYS.SDO_GEOM.SDO_DISTANCE(lot_geom.geometry, ped_geom.geometry, 0.5),2) dist
    FROM lot_f,
    pedestal_f,
    G_GEOMETRY_0 lot_geom,
    G_GEOMETRY_0 ped_geom
    WHERE lot_f.feat_num = lot_geom.feat_num
    AND pedestal_f.acc_point_id = 611
    AND pedestal_f.feat_num = ped_geom.feat_num
    AND lot_f.g_version+0 = 0
    AND (lot_f.g_next_version > 0 OR lot_f.g_next_version IS NULL)
    AND pedestal_f.g_version+0 = 0
    AND (pedestal_f.g_next_version > 0 OR pedestal_f.g_next_version IS NULL)
    AND MDSYS.SDO_WITHIN_DISTANCE(lot_geom.geometry, ped_geom.geometry,
    'distance = 100' ) = 'TRUE';
    So I "forced" a plan that uses the spatial indexes deleting the statistics from the tables that have geometry columns. The execution plan looks like this:
    Execution Plan
    0 SELECT STATEMENT Optimizer=CHOOSE (Cost=2652 Card=10182 Bytes=79969428)
    1 0 CONCATENATION
    2 1 NESTED LOOPS (Cost=876 Card=3428 Bytes=26923512)
    3 2 NESTED LOOPS (Cost=121 Card=1078 Bytes=8450442)
    4 3 NESTED LOOPS (Cost=4 Card=33 Bytes=129492)
    5 4 TABLE ACCESS (FULL) OF 'PEDESTAL_F' (Cost=1 Card=1 Bytes=16)
    6 4 TABLE ACCESS (BY INDEX ROWID) OF 'G_GEOMETRY_0' (Cost=3 Card=3268 Bytes=12771344)
    7 6 INDEX (RANGE SCAN) OF 'G_GEOMETRY_0_PRIMARY' (UNIQUE) (Cost=2 Card=3268)
    8 3 TABLE ACCESS (BY INDEX ROWID) OF 'G_GEOMETRY_0' (Cost=121 Card=3268 Bytes=12794220)
    9 8 DOMAIN INDEX OF 'G_GEOMETRY_0_SI' (Cost=51)
    10 2 TABLE ACCESS (BY INDEX ROWID) OF 'LOT_F' (Cost=1 Card=318 Bytes=4770)
    11 10 INDEX (RANGE SCAN) OF 'GI_LOT_F0_FEAT_NUM_0' (UNIQUE) (Cost=1 Card=318)
    12 1 NESTED LOOPS (Cost=876 Card=3428 Bytes=26923512)
    13 12 NESTED LOOPS (Cost=121 Card=1078 Bytes=8450442)
    14 13 NESTED LOOPS (Cost=4 Card=33 Bytes=129492)
    15 14 TABLE ACCESS (FULL) OF 'PEDESTAL_F' (Cost=1 Card=1 Bytes=16)
    16 14 TABLE ACCESS (BY INDEX ROWID) OF 'G_GEOMETRY_0' (Cost=3 Card=3268 Bytes=12771344)
    17 16 INDEX (RANGE SCAN) OF 'G_GEOMETRY_0_PRIMARY' (UNIQUE) (Cost=2 Card=3268)
    18 13 TABLE ACCESS (BY INDEX ROWID) OF 'G_GEOMETRY_0' (Cost=121 Card=3268 Bytes=12794220)
    19 18 DOMAIN INDEX OF 'G_GEOMETRY_0_SI' (Cost=51)
    20 12 TABLE ACCESS (BY INDEX ROWID) OF 'LOT_F' (Cost=1 Card=318 Bytes=4770)
    21 20 INDEX (RANGE SCAN) OF 'GI_LOT_F0_FEAT_NUM_0' (UNIQUE) (Cost=1 Card=318)
    But when I executed the query, I got:
    cc_redes_met_coaxial@ORAG2> /
    ROUND(MDSYS.SDO_GEOM.SDO_DISTANCE(lot_geom.geometry, ped_geom.geometry, 0.5),2) dist
    ERROR at line 2:
    ORA-03113: end-of-file on communication channel
    Collecting stats on geometry tables makes the query work only because it doesn't use the spatial index.
    I took a look the trace file, but I didn't see any interesting information. I can send you if you want.
    Do you have any clue?
    Regards,
    Alex

  • I have tried to download version11.1 to my itunes so that I can transfer all my info to my new iphone 5 c i am using an imac operating system 10.6.8 OSX it will not allow me to download this !x

    i have tried to download version11.1 to my itunes so that I can transfer all my info to my new iphone 5 c i am using an imac operating system 10.6.8 OSX it will not allow me to download this !

    What error message ar eyou getting. Why do you say it will not allow you to download?
    Verify you meet all the system requirements:
    Mac computer with an Intel Core processor
    OS X version 10.6.8 or later
    400MB of available disk space
    Broadband Internet connection to use the iTunes Store

  • How can I use the update operation in a VC Model

    Hello experts,
    i try to to use the update operation in my VC model.  I have developed an AS wich return a table. Now i want to update a table row. So I add the update operation to my model. But it doesn´t work. I mapped all attribute between the table and the update service. The event name is submit.
    Another strange thing is: If i try to update in the service browser it cames the error message that the vandatory attribute ... is missing.
    Any ideas??
    Thanks
    Marco

    Hi Marco,
    In this case it is possible that your update service requires a mandatory parameter which you are not providing.
    When you drag your service onto the VC screen, right click on the service and test it.It will give you a clear picture of which parameters are required by the service and besides you can also use some test data to check if the service is working properly.
    Do let me know if this helps.
    Thanks,
    Gaurav.

  • Calling a WS from a servlet...EndpointPort does not contain operation meta.

    Hi all,
    I'm trying to call a service from a servlet but I get an error:
    Error: Endpoint {http://com.susan/SusanWS}SusanWebServiceEndpointPort does not contain operation meta data for: LoginWebService
    ...the WS is up and running (of this I'm sure...cause I also tested it with soapui...and it works..)
    The webservice is running on a local jboss (to which i can successfully connect, and see the wsdl...).
    the servlet is running on a local tomcat (which is also ok...).
    I'm trying to call the WS like this:
    Service service = new Service();
    Call call = (Call)service.createCall();
    call.setTargetEndpointAddress( new URL( wsEndpoint ) ); //http://localhost:8080/webservices/SusanWS (the same I used in soapui...so it should be right)
    call.setOperationName( "LoginWebService"); //name of the method i want to use...
    call.addParameter( "appCode", Constants.XSD_STRING, ParameterMode.IN );
    call.addParameter( "login", Constants.XSD_STRING, ParameterMode.IN );
    call.addParameter( "passwd", Constants.XSD_STRING, ParameterMode.IN );
    //            call.setReturnType( Constants.XSD_INT ); //left this out...should be the cause...
    Object retval = call.invoke( new String[] { appCode, login, passwd} ); //appCode,login,passwd contain the strings i want to  forward as input.if I try to run it I get(in the jboss log...):
    15:41:55,594 ERROR [SOAPFaultExceptionHelper] SOAP request exception
    javax.xml.rpc.soap.SOAPFaultException: Endpoint {http://com.susan/SusanWS}SusanWebServiceEndpointPort does not contain operation meta data for: LoginWebService
    at org.jboss.ws.server.ServiceEndpointInvoker.getDispatchDestination(ServiceEndpointInvoker.java:181)
    at org.jboss.ws.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:107)
    at org.jboss.ws.server.ServiceEndpoint.handleRequest(ServiceEndpoint.java:209)
    at org.jboss.ws.server.ServiceEndpointManager.processSOAPRequest(ServiceEndpointManager.java:355)
    at org.jboss.ws.server.StandardEndpointServlet.doPost(StandardEndpointServlet.java:115)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.jboss.ws.server.StandardEndpointServlet.service(StandardEndpointServlet.java:76)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
    at java.lang.Thread.run(Thread.java:595)
    don't know if it can help...the soapui request looks like this:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://com.susan/SusanWS/types">
    <soapenv:Header/>
    <soapenv:Body>
    <typ:LoginWebService>
    <LoginInfo_1>
    <appCode>WEB_SERVICES</appCode>
    <login>root</login>
    <passwd>root</passwd>
    </LoginInfo_1>
    </typ:LoginWebService>
    </soapenv:Body>
    </soapenv:Envelope>
    anybody has an idea of what I'm doing wrong?
    Edited by: Turbo-555 on Mar 18, 2009 8:36 AM

    if I change the code with:
    //call.setOperationName( wsMethod );
    call.setOperationName( new QName("http://com.susan/SusanWS",wsMethod)); //http://com.susan/SusanWS is the targetnamespace...the error changes into:
    16:55:21,051 ERROR [SOAPFaultExceptionHelper] SOAP request exception
    javax.xml.rpc.JAXRPCException: Cannot find child element: {http://com.susan/SusanWS/types}LoginWebService
    at org.jboss.ws.binding.soap.SOAPBindingProvider.getParameterFromMessage(SOAPBindingProvider.java:799)
    at org.jboss.ws.binding.soap.SOAPBindingProvider.unbindRequestMessage(SOAPBindingProvider.java:282)
    at org.jboss.ws.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:112)
    at org.jboss.ws.server.ServiceEndpoint.handleRequest(ServiceEndpoint.java:209)
    at org.jboss.ws.server.ServiceEndpointManager.processSOAPRequest(ServiceEndpointManager.java:355)
    at org.jboss.ws.server.StandardEndpointServlet.doPost(StandardEndpointServlet.java:115)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.jboss.ws.server.StandardEndpointServlet.service(StandardEndpointServlet.java:76)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
    at java.lang.Thread.run(Thread.java:595)

  • NOT IN operator giving the wrong results

    DB version:10gR2
    Why is NOT IN giving the wrong results. Isn't NOT EXISTS operator a flawless alternative to NOT IN?
    create table my_table1 (col1 number);
    insert into my_table1 values (1);
    insert into my_table1 values (2);
    commit;
    create table my_table2 ( col1 number);
    insert into my_table2 values (1);
    commit;
    select * from my_Table1;
           COL1
              1
              2
    select * from my_table2;
           COL2
              1
      --correct result
      SELECT * FROM my_table1 t1 WHERE NOT EXISTS
    (SELECT * FROM my_table2 t2 WHERE t1.col1 = t2.col1)
           COL1
              2
    ---correct result using IN
    SELECT * FROM my_table1 t1 where col1 not in (select col1 FROM my_table2 t2);
           COL1
              2
    Inserting a NULL to my_Table2
    Now the query using NOT IN is returning wrong results.
    insert into my_table2 values (null);
    commit;
    SELECT * FROM my_table1 t1 where col1 not in (select col1 FROM my_table2 t2);
    no rows selected
    Query using NOT EXISTS is still giving the right results.
    SELECT * FROM my_table1 t1 WHERE NOT EXISTS
       (SELECT * FROM my_table2 t2 WHERE t1.col1 = t2.col1);
           COL1
              2

    ScottsTiger wrote:
    can i use NOT EXISTS(with a proper Co-related subquery) as a safe alternative to NOT IN?Depends on your data and what you need to achieve.
    Personally I avoid using NOT EXISTS or NOT IN if I can really help it.
    My preferred method is to outer join the tables together and then remove any resultant rows where a value exists and I didn't want one. ;)

  • How to use Not Null in

    Hi All,
    I did one personalization which is related to DFF of an Item.
    It is working partially but i need the perfect solution will u please resolve my doubts.
    My requirement is as follows:
    I have one DFF in Items page say attribute1 which has a maximum of 3 values i.e., 'A' or 'B' or 'C'
    In my Purchase order Auto create form, when an select an requisition, the related lines are displayed for me.
    When i select an line and if the line has an item which has an attribute values of either 'A' or 'B' or 'C'.
    Then i need to display an error message.
    For this I do the following steps.
    In conditions tab i wrote the following condiitons:
    Not Null IN ( SELECT attribute1 FROM mtl_system_items_b where segment1= :REQ_LINES.ITEM_NUMBER AND organization_id=FND_PROFILE.VALUE('ORG_ID'))
    But my condition evaluates to false, even though i have values in attribute1---------------------- My question is will the above query is right or not. if not will u please provide me the correct syntax of how to use not null.
    'A' IN ( SELECT attribute1 FROM mtl_system_items_b where segment1= :REQ_LINES.ITEM_NUMBER AND organization_id=FND_PROFILE.VALUE('ORG_ID'))
    The above query is working fine. Please help me on this issue.
    Thanks and Regards
    Zaheer

    Dear Zaheer,
    you compare the organization with Operating unit, Please use
    fnd_profile.value('MFG_ORGANIZATION_ID') inspite of org_id.
    Tariq.

  • LabView (8.2) hangs when using I/O operations with traditiona​l NI-DAQ 7.4.4 after aborting LabView program

    Hello!
    We have the following problem:
    LabView (8.2) hangs when using I/O operations with traditional NI-DAQ 7.4.4 after aborting LabView program
    We freshly installed LabView 8.2 (2006) and NI-DAQ 7.4.4 on a PC running Windows XP (Service Pack 3). We built a larger vi that remotely controls a traditional NI-DAQ card (AT-AO-10) on a second PC via NI-VISA 5.0.3. We were successfully running this program until a power failure caused the first computer to crash. After this crash we were unable to start the program again: LabView freezes while loading the vi. LabView itself can be started but freezes when adding I/O operations from the NI-DAQ palette to a block diagram.
    We have tried to re-install NI-DAQ 7.4.4, but it did not help. We then re-installed all NI software, but still no improvement. In the end we decided to reinstall ALL software, first Windows XP, then LabView and finally NI-DAQ 7.4.4. This worked. However, after a few days of running the program we had to abort LabView via Windows Task manager and afterward we again experienced the same problem as before: LabView freezes when loading the program.
    Obviously, we cannot afford to reinstall Windows every time. Are there any known Windows XP / NI-DAQ issues that might cause the freezing of LabView? We would be very grateful for any idea.
    Best regards,
    Matthias

    Hello Sprice,
    Browse the shipping examples according to “Directory Structure” and then select
    DAQ to find the Traditional DAQ examples. 
    There a lot of examples that are written for counters (Counter >>
    daq-stc.llb >> Count Edges (DAQ-STC).vi). 
    What kind of signals are your photons creating?  Are they TTL compatible at a certain
    frequency?  You don’t care about overwriting
    your buffer?
    Respectfully,
    Rob F
    Test Engineer
    Condition Measurements
    National Instruments

  • Hi I am in travel and I use from Iran operator. but my iphone is locked for it. please open it for me

    hi I am in travel and I use from Iran operator. but my iphone is locked for it. please open it for me or help me anyway can please

    Since the iPhone is not officially sold in Iran, & there are no supported carriers there, you couldn't have an iPhone locked to a carrier in Iran.
    At any rate, if you do have a carrier locked iPhone, you need to contact the carrier the phone is locked to to get it officially unlocked. No one here can help you, nor can/will Apple.

  • NOT IN Operator

    Hi Friends,
    I am having problem in Not IN Operator.
    My Query is--
    select ord_no,ord_date
    from ord_tab
    where NVL(stat_flag,'P') not in ('I','i');
    it should not give any data.
    but is' giving me data.
    when i remove NVL, It work fine.
    but in some cases it can be null.
    how to solve this ? any other alternative for this.
    Regards
    KarTiK PareeK.

    Or you can use CASE, I find it more readable, especially when you have multiple OR's or AND's:
    select  ord_no
    ,       ord_date
    from    ord_tab
    where 
            ( CASE
                       WHEN stat_flag NOT IN ('I','i') THEN 1  --  could be written as  WHEN UPPER(stat_flag) != 'I' THEN 1 too by the way
                       WHEN stat_flag IS NULL THEN 1
              END ) = 1Edited by: hoek on Apr 1, 2009 6:14 PM

  • Use of q operator in oracle 11g

    Hi,
    I am looking for following data Rewards–ALL (UK/IE,US,Germany & China). even though i have used q operator. when report is generated using following query
    and UTL_FILE in excel sheet it show following data
    Rewards–ALL (UK/IE,US,Germany & China)here is the query. sql developer worksheet result tab shows Rewards–ALL (UK/IE,US,Germany & China) though
    SELECT 'c' temp,q'#Rewards–ALL (UK/IE,US,Germany & China)#'
    FROM memberhistory mlhthanks
    sandy
    Edited by: Sandy310 on Apr 27, 2010 5:10 PM
    Edited by: Sandy310 on Apr 27, 2010 5:10 PM

    First, it appears you have an illegal ASCII character after REWARDS - the "–" character.
    Did you SET ESCAPE ON ?
    Here is what I did after changing out the illegal character in SQL Developer, I executed it as a script.
    set escape on
    SELECT  'c' temp
            ,q'[Rewards-ALL (UK/IE,US,Germany \& China)]'  search_string
    FROM
             dual   ;
    TEMP SEARCH_STRING                         
    c    Rewards-ALL (UK/IE,US,Germany & China)I don't know why you are using the q operator. It is designed to eliminate the need for doubling up single quotes - the string you have does not have any quotes.

  • Select Performance problems using the 'like' operator

    I have a PL/SQL procedure that uses a cursor which contains a 'like' operator in the where clause. I have two database instances that are theoretically the same, however this code processes about 100,000 rows in 5 minutes on one database and 100,000 rows in several weeks on the other database. I know it is the 'like' operator that is causing the problem, but I don't know where to look in the database setup parameters as to what could be different between the two. Can someone point me in the right direction?

    I tried to think of another way to write the query, but I really need to use the wildcard option on the data I'm searching for. The system I'm working with attaches a suffix to the end of every ID (ie. '214-222-1234-0') The suffix ('-0') increments but the rest of the ID stays the same ('-1','-2',etc...), but I want to find all of the rows where the first 12 characters are the same, so I strip off the suffix and use a wildcard '%' in its place. I tried adding the SUBSTR() function to the left hand column of the where clause, but it was even slower than using the 'like' operator. I know its a sound query, I just can't figure out why it works fine on one database and not the other.

Maybe you are looking for