IN clause with multivalue tuple with NULLS?

I have a table somewhat like this:
mytable
pk NUMBER(20) NOT NULL,
ak1.1 NUMBER(20) NOT NULL,
ak1.2 NUMBER(20) NOT NULL,
ak1.3 VARCHAR2(255) NULL,
otherstring VARCHAR2(255) NULL
So I have a 3 part alternate key containing 2 long values and one string the longs are not null but the string value could be null.
I want to retrieve from this table like this:
select pk, ak1.1, ak1.2, ak1.3 from mytable where (ak1.1, ak1.2, ak1.3) IN ((100, 500, 'string'), (300, 500, NULL));
The problem I am having is the most of the values in the table have null in AK1.3 and it appears that the keyword NULL in the later half of the IN clause does not work. Is there some trick to be able to have it match alternate keys where one of the values is null using this method? I have tried NULL and IS NULL neither worked I tried matching one of these tuples in the following manner:
select pk, ak1.1, ak1.2, ak1.3 from mytable where ak1.1 = 500 and ak1.2 = 600 and ak1.3 IS NULL;
That matched so I am fairly certain the value is actually null but I need to be able to fetch it with an in clause because I am matching a list that could actually be hundreds of tuples so this second approach isn't very practical. Any suggestions appreciated.
Thanks!

Try this
select pk, ak1.1, ak1.2, ak1.3
from   mytable
where  ( (ak1.1, ak1.2, ak1.3) IN (
            (100, 500, 'string')
            <other non-null values for each column>...
        OR
         (ak1.1, ak1.2) IN (
            (300, 500),
            <other ak1.1 and ak1.2 pair where ak1.3 is null )
          AND ak1.3 IS NULL
        ) Not sure about the performance though, but you can check the explain plan.

Similar Messages

  • I just order 8 calendars from iPhoto and they came to me fine. Now I need to order two more but when I go thru the process I get a message  saying:unable to assemble calendar. There is a probleme with the photo with the file name"(Null)"   more........ .

    Would someone be able to explain to me the following issue with Iphoto?
    I ordered 8 same calendars for my soccer team and received them fine. Although a couple of pictures on it are a little off (out of focus). I need to order two more of the same calendars but when I go thru the process ireceive an error message saying:
    "Unable to to assemble  calendar" There is a problem with the photo with the file name "(Null)" The full resolution version of this photo either cannot be located or is corrupt. Please replace this photo or delete it from your calendar.
    How can  I fine this "corrupt" photo? How did it go thru with the first batch of calendars but won't go thru now?
    Thank you for your help.   

    Apply the two fixes below in order as needed:
    Fix #1
    Launch iPhoto with the Command+Option keys held down and rebuild the library.
    Since only one option can be run at a time start
    with Option #4 and then #1 as needed.
    Fix #2
    Using iPhoto Library Manager  to Rebuild Your iPhoto Library
    1 - download iPhoto Library Manager and launch.
    2 - click on the Add Library button, navigate to your Home/Pictures folder and select your iPhoto Library folder.
    3 - Now that the library is listed in the left hand pane of iPLM, click on your library and go to the File ➙ Rebuild Library menu option.
    4 - In the next  window name the new library and select the location you want it to be placed.
    5 - Click on the Create button.
    Note: This creates a new library based on the LIbraryData.xml file in the library and will recover Events, Albums, keywords, titles and comments.  However, books, calendars, cards and slideshows will be lost. The original library will be left untouched for further attempts at fixing the problem or in case the rebuilt library is not satisfactory.
    OT

  • Oracle 11.1.0.7.0 Issue with Streams when using NULL value in a key field

    Hi,
    we have an issue in our replicated environment using Streams.
    We have a replicated table using the following index:
    UK_S01_TEXT_FORMAT_TBL01 SOGID
    UK_S01_TEXT_FORMAT_TBL01 INDEX_TEXT_FORMAT_ID
    UK_S01_TEXT_FORMAT_TBL01 INDEX_LANGUAGE_LABEL
    UK_S01_TEXT_FORMAT_TBL01 INDEX_TEXT_FORMAT_COUNTER
    UK_S01_TEXT_FORMAT_TBL01 INDEX_PROVIDER_ID
    UK_S01_TEXT_FORMAT_TBL01 INDEX_TARIFF_PLAN_COSP_ID
    with field INDEX_PROVIDER_ID allowing NULL values. Actually we insert empty strings in there, but as far as I understand Oracle will convert it sliently in a NULL value, which is fine to our application.
    When we apply a change on that table (either update or delete) we get errors at streams level and the transaction is not propagated.
    Local Transaction ID: 6.28.11170
    Source Commit SCN: 25397175
    Source Commit Time: Dec-03-2012 12:21:30
    Error in Message: 1
    Error Message: ORA-26787: The row with key ("INDEX_LANGUAGE_LABEL", "INDEX_PROVIDER_ID", "INDEX_TARIFF_PLAN_COSP_ID", "INDEX_TEXT_FORMAT_COUNTER", "INDEX_TEXT_FORMAT_ID", "SOGID") = (ITALIAN, , , 0, MIKE, 124) does not exist in table
    SMS.S01_TEXT_FORMAT_TBL
    ORA-01403: no data found
    message: 1
    TableName: S01_TEXT_FORMAT_TBL
    Operation Type: DELETE
    _____ Old Data _____
    SOID : 1010000008
    SOGID : 124
    INDEX_TEXT_FORMAT_ID : MIKE
    INDEX_LANGUAGE_LABEL : ITALIAN
    INDEX_TEXT_FORMAT_COUNTER : 0
    TEXT_FORMAT : Hai raggiunto i 100MB di traffico incluso nello scatto
    APPLICA_PERIOD_CRI_ID :
    INDEX_TARIFF_PLAN_COSP_ID :
    INDEX_PROVIDER_ID :
    If I force the set of primary keys to be only the NOT NULL fields, I can successfully apply the error, but since we may have them storing both NULL and NOT NULL values, this is not a solution.
    I'm wondering why the DB on one hand converts the empty string in a NULL while inserting, but it looks the Apply process onStandby is not able to do the same when looking for the record before applying the transaction.
    Thanks in advance!
    Cheers,
    Mike

    Its showing all objects the user has permission to see- why does that need to be restricted?

  • There is a problem with the photo with the filename "null". The full resolution version of this photo either cannot be located or is corrupt. Please replace this photo or delete it from your book.

    Absolutely INFURIATING.
    I have spent absolute hours building a photo album for the first year or my sons life. Sorting through quite literally thousands and thousands of images. Got a brilliant looking album using 177 of them.
    Now everytime I try to check out it won't get past page 1 of building the book.
    It says the following "There is a problem with the photo with the filename "null". The full resolution version of this photo either cannot be located or is corrupt. Please replace this photo or delete it from your book.".
    The images all look perfect. I have even tried taking them out and re adding the first page images from the library.
    Same problem.
    This is so annoying. So far I have NOT been happy with this iphoto application having nothing but problems with missing thumbnails. Corrupted images. Things that have never happened to me using a windows machine.

    Do the filenames contain special characters, like "ä,ü,..." or white space or are the vry long? Is there anything special about the image format? Try to export the edited versions in that case and reimport it with a different, shorter filename.
    For testing, create a new book with only the images you want to check.
    If this does not fix it, try rebuilding. Depress the option and command keys, launch iPhoto and rebuild the library.

  • ORA-25143: default storage clause is not compatible with allocation policy

    Dears,,
    While running the following command , it gave me error:
    ALTER TABLESPACE USER_DATA default storage (MAXEXTENTS unlimited);
    ERROR at line 1:
    ORA-25143: default storage clause is not compatible with allocation policy
    I tried a lot for that error and tested all possible solutions but without result.
    Is there any one faced this error before?
    Thanks & Best regards,,

    Dear,,
    As i said before in previous reply that:
    I can not give a default storage clause to a local managed tablespace.
    So, only i increased spaces for data files
    Also,see the following . . .
    SQL> ALTER TABLESPACE ts_name default storage (MAXEXTENTS 1000);
    ALTER TABLESPACE ts_name default storage (MAXEXTENTS 1000)
    ERROR at line 1:
    ORA-25143: default storage clause is not compatible with allocation policy
    SQL> ALTER TABLESPACE ts_name storage (MAXEXTENTS 1000);
    ALTER TABLESPACE ts_name storage (MAXEXTENTS 1000)
    ERROR at line 1:
    ORA-02142: missing or invalid ALTER TABLESPACE option
    I already solved my issue by increasing spaces for data files
    Thanks for support and help
    Best regards,,

  • Joining a "now" window with a tuple-based window

    I got an error when writing a CQL query that joins 2 streams, one with a "now" window and one with a tuple-based window, like:
    select * from stream1[now], stream2[rows 1]
    When this query fires, I get a "TableSource not defined" error for stream1. When I change stream2[rows 1] to a range-based window, like stream2[range 1 seconds], the error goes away. What could be causing this issue?

    Hi prajulakc,
    Thank you for your question. Currently the active window selected when you create a new window that new window will take the active window's screensize.
    You can add a preference: see also [https://support.mozilla.org/en-US/questions/754273 question/754273]

  • Is it possible to create a Column with Conditional Mandatory with another Column?

    Is it possible to create a Column with Conditional Mandatory with another Column?
    For example
    In a Table we have column A, B, C.
    A is Primary Column.
    B is Optional
    C is Conditional Mandatory.
    A B
    C
    12345 ABC
    OK
    12346 NULL
    NULL
    12347 ABC
    OK
    Only if the B Column has the value then only C column should be mandatory

    I guess you can't create a condtional mandatory column directly. However, you can use check constraint to on the column
    create table YourTable
      A int primary key,
      B char(3),
      C int,
      constraint ch_con check(
                                B
    is not null
    or C is null

  • Singing XML Data with PKCS#7 with SHA1withRSA

    Dear All
    I am using the following code to sign xml message with PKCS#7 with SHA1withRSA. But I am facing bad signature error from the server, they are telling me that this is signed correctly.
    Please can anybody give some idea that i doing correctly as PKCS#7 with SHA1 algorithm.
    I am using bouncy castle libraries
      private byte[] sign(String input) {
            Security.addProvider(new BouncyCastleProvider());
            byte[] encoded = null;
            try {
                KeyStore keystore = loadKeyStore();
                Certificate[] certchain =
                    (Certificate[])keystore.getCertificateChain(MaadenPropertiesConstants.KEYSTORE_Alias);
                final List<Certificate> certlist = new ArrayList<Certificate>();
                for (int i = 0, length = certchain == null ? 0 : certchain.length;
                     i < length; i++) {
                    certlist.add(certchain[i]);
                PrivateKey key =
                    (PrivateKey)(keystore.getKey(MaadenPropertiesConstants.KEYSTORE_Alias, MaadenPropertiesConstants.KEYSTORE_PWD.toCharArray()));
                ContentSigner signer =
                    new JcaContentSignerBuilder("SHA1withRSA").setProvider("BC").build(key);
                CMSSignedDataGenerator generator = new CMSSignedDataGenerator();
                generator.addSignerInfoGenerator(new JcaSignerInfoGeneratorBuilder(new JcaDigestCalculatorProviderBuilder().setProvider("BC").build()).build(signer,
                                                                                                                                                             (X509Certificate)keystore.getCertificate(MaadenPropertiesConstants.KEYSTORE_Alias)));
                generator.addCertificates(new JcaCertStore(certlist));
    //            CMSSignedData signedData =
    //            generator.generate(new CMSProcessableFile(new File(this.inputFile)),
    //                                   true); //changed to false
                CMSTypedData msg;
                msg = new CMSProcessableByteArray(input.getBytes());
                CMSSignedData signedData = generator.generate(msg, true);
                encoded = signedData.getEncoded();
                System.out.println("Got encoded pkcs7 bytes " + encoded.length +
                                   " bytes");
            } catch (Exception e) {
                e.printStackTrace();
            return encoded;
        private static KeyStore loadKeyStore() throws Exception {
            KeyStore keystore =
                KeyStore.getInstance(MaadenPropertiesConstants.KEYSTORE_INSTANCE);
            InputStream is =
                new FileInputStream(MaadenPropertiesConstants.keystoreLocation);
            keystore.load(is,
                          MaadenPropertiesConstants.KEYSTORE_PWD.toCharArray());
            return keystore;

    Dear All
    I am using the following code to sign xml message with PKCS#7 with SHA1withRSA. But I am facing bad signature error from the server, they are telling me that this is signed correctly.
    Please can anybody give some idea that i doing correctly as PKCS#7 with SHA1 algorithm.
    I am using bouncy castle libraries
      private byte[] sign(String input) {
            Security.addProvider(new BouncyCastleProvider());
            byte[] encoded = null;
            try {
                KeyStore keystore = loadKeyStore();
                Certificate[] certchain =
                    (Certificate[])keystore.getCertificateChain(MaadenPropertiesConstants.KEYSTORE_Alias);
                final List<Certificate> certlist = new ArrayList<Certificate>();
                for (int i = 0, length = certchain == null ? 0 : certchain.length;
                     i < length; i++) {
                    certlist.add(certchain[i]);
                PrivateKey key =
                    (PrivateKey)(keystore.getKey(MaadenPropertiesConstants.KEYSTORE_Alias, MaadenPropertiesConstants.KEYSTORE_PWD.toCharArray()));
                ContentSigner signer =
                    new JcaContentSignerBuilder("SHA1withRSA").setProvider("BC").build(key);
                CMSSignedDataGenerator generator = new CMSSignedDataGenerator();
                generator.addSignerInfoGenerator(new JcaSignerInfoGeneratorBuilder(new JcaDigestCalculatorProviderBuilder().setProvider("BC").build()).build(signer,
                                                                                                                                                             (X509Certificate)keystore.getCertificate(MaadenPropertiesConstants.KEYSTORE_Alias)));
                generator.addCertificates(new JcaCertStore(certlist));
    //            CMSSignedData signedData =
    //            generator.generate(new CMSProcessableFile(new File(this.inputFile)),
    //                                   true); //changed to false
                CMSTypedData msg;
                msg = new CMSProcessableByteArray(input.getBytes());
                CMSSignedData signedData = generator.generate(msg, true);
                encoded = signedData.getEncoded();
                System.out.println("Got encoded pkcs7 bytes " + encoded.length +
                                   " bytes");
            } catch (Exception e) {
                e.printStackTrace();
            return encoded;
        private static KeyStore loadKeyStore() throws Exception {
            KeyStore keystore =
                KeyStore.getInstance(MaadenPropertiesConstants.KEYSTORE_INSTANCE);
            InputStream is =
                new FileInputStream(MaadenPropertiesConstants.keystoreLocation);
            keystore.load(is,
                          MaadenPropertiesConstants.KEYSTORE_PWD.toCharArray());
            return keystore;

  • Problem embedding fonts with ButtonSkin class with SDK 4.5.1

    Hi,
    I've an external style file calling into main mobile application which has codes something like these:
    @font-face {
              src: url("../fonts/TektonPro-BoldCond.otf");
      fontFamily: TektonProBCnd;
      embedAsCFF: false;
    .buttonStyle {
      embedFonts: true;
      fontFamily: TektonProBCnd;
      fontSize: 24;
      skin: ClassReference(null);
    .text_listMediumText {
      fontFamily: TektonProBCnd;
      fontSize: 24;
              color:                               #666666;
    In my application the embedding font styles working properly when directly bind with any component with 'styleName' property (i.e. text_listMediumText). I've also one button something like this:
    <s:Button label="CONNECT" skinClass="actionScripts.ui.SketchButtonSkin" click="onConnect()"/>
    And the skin class is as follows:
    public class SketchButtonSkin extends ButtonSkin
      //  PRIVATE VARIABLES
                         * CONSTRUCTOR
                        public function SketchButtonSkin()
                                  super();
                                  width = 268;
                                  height = 50;
      //  OVERRIDDEN API
      // Override this function to prvent the button from drawing a background
                        override protected function drawBackground(unscaledWidth:Number,
                                                                                                                               unscaledHeight:Number):void{
      override protected function
                                  labelDisplay_valueCommitHandler(event:FlexEvent):void
                                  labelDisplay.setStyle( "fontSize", 20 );
                   labelDisplay.setStyle("fontFamily","TektonProBCnd"); // or, labelDisplay.styleDeclaration = styleManager.getStyleDeclaration(".buttonStyle");
    But I not ever could embed the font with this buttonSkin class. Any help please (?)

    Try linking a Scroller into your app.

  • NPE with WebService client with JDeveloper 10.1.3

    Hi folks,
    I am having weird NullPointerException with a WebService client I generated with the WEB Service Proxy wizard in JDeveloper 10.1.3.
    The thing is, the client runs fine as long as there are NO NULL FIELDs in the "double" type returned objects. I don't know about other types, but I am sure it fails with doubles.
    If there is a NULL value in the returned Bean, then marshaling fails with a NullPointerException.
    I guess it is not a Server problem since clients in .NET and AXIS works just fine.
    I don't think it has anything to do with it, but, server is in JBoss-4.0.4.GA with JBossWS-1.0.3.
    May be a bug in JDEV's WebService client code?
    The first line is the deserializer returning a null value. The second is the line with the NPE:
    member = myns2__double__double_Double_Serializer.deserialize(ns4_r1_IA_C1_QNAME, reader, context);
    instance.setR1_IA_C1(((Double)member).doubleValue());
    Any help will be appreciated.
    Best regards.

    This is not an elegant solution.
    I’ve the same problem you have, so the only thing that I thought to solve this problem was to change the sentences one by one replacing with if(member != null) between both sentences.
    I use an editor that can change regular expressions.
    This works fine, but I think there might be a better solution.
    I hope this can help.
    Regards.

  • BW 3.5 - Issue with formula variable with replacement path

    Dear experts,
    I'm facing an issue with formula variable with replacement path.
    Just to clarify, I know replacement paths is raising a lot of questions but I've been using this functionnality extensively in the past, both in 7.0 and 3.5, so I'm not looking for basic information about how to use it.
    I'm trying to setup a simple report that would show total values per plant of Purchase Order < 100 €
    To do so I've setup a calculated key figure as follow:
    VAR1 * ("PO value" < 100 ) * "PO value"
    VAR1 is a formula variable with replacement path on 'purchase order' and value attribute 'constant =1'.
    (The report has to show values summarized by plant but should not show the detail PO by PO, so I'm not looking at a solution based on condition)
    The report as characteristic "plant" in rows and my CKF in columns.
    Now let's take an example. I have 3 POs in Plant 1:
    PO1 -> 150€
    PO2 -> 90€
    PO3 -> 80€
    Because of the variable with replacement path, the result in my query should be:
    plant1 = 170 (even though characteristic "purchase order" is not in my rows, system should evaluate PO one by one and return values only for those two that are below 100).
    But the result coming is 320, which is wrong.
    I've done the same report on many other 3.5 systems and it worked perfectly, and I am not able to get proper support from SAP OSS who keep saying that this functionnality is not ready in 3.5 (although I've provided screenshot of this working on another 3.5 system!!! how frustrating...)
    They have also pointed to problems of Before and After aggregation but that has absolutely no impact. Once again, the scenario is working perfectly on other 3.5 systems with the same query design, so i'm sure it has nothing to do with Query Designer options.
    Would anyone have ever come to an equivalenet problem? I'm wondering whether the DB itself could not play a role in the variable with ref  characteristic 'constant =1' ...
    Any though is welcome!
    thanks

    Hi,
    The text variable is replaced when the exact date is clear for this key figure column according to the restriction.
    To achive this, please make sure that either the variable is directly restricted in the key figure selection, or that the date characteristic is in drilldown.
    Regards,
    Patricia

  • The problem I have since I upgraded to Mavericks version 10.9.1 The problem appears only with Mail not with other programs, not even with my browser. When I try to zoom the text of an e-mail I received or sent , I can no longer use the keys Command   to e

    the problem I have since I upgraded to Mavericks version 10.9.1
    The problem appears only with Mail not with other programs, not even with my browser.
    When I try to zoom the text of an e-mail I received or sent , I can no longer use the keys Command + to enlarge the text, although I can reduce it with Command -.
    As I have a problem with my eyes, This is a serious matter for me.
    When I write an e-mail, if I select text and press Command +, it just displaces the text to the right.
    Now, my husband has a USB keyboard. If he connects it to my computer, his regular Command + does not work either, but  he uses the extended keyboard, then it works. Unfortunately, he needs it for a musical application which does not work with a wireless keyboard.

    Firefox 3.6.4 and 3.6.6 use a process called, "plugin-container.exe" which was using up most of my CPU when I opened up multiple tabs that contained Adobe Flash files, and caused Firefox to lock up.
    My solution was to use Firefox 3.5.10 which you can get from the Mozilla website at [http://www.mozilla.com/en-US/firefox/all-older.html]
    I am using Adobe Flash 10.1.53.64 without any problem in this version of Firefox. Check the release notes, I believe it contains all the latest security fixes in "Firefox 3.6.4".
    Hopefully, they will fix Firefox 3.6 in the next version (e.g. Firefox 3.6.7), until then you should probably use "Firefox 3.5.10".

  • My iPhone 4 will not sync my new voice memos from the "Voice Memos" app to my computer. This is frustrating, should not be so hard, can someone please help. I use PC with windows 7 with iPhone version 6.1.3 and iTunes most recent. Thanks.

    My iPhone 4 will not sync my new voice memos from the "Voice Memos" app to my computer. This is frustrating, should not be so hard, can someone please help. I use PC with windows 7 with iPhone version 6.1.3 and iTunes most recent. Thanks.

    In the Music tab of iTunes, do you have 'Include Voice Memos' checked?

  • Problems with compressing  files with right hand click. it does not work.

    Problems with compressing files with right hand click.
    I am using the compress function in the Mac OS (File > Compress XX) from time to time. Today it does not work anymore. OS 10.5.6
    I get a message: The content list cannot be created for compressing.
    I tried it with files and folders and keep getting this message. Anybody any idea as to how to fix this

    Thanks I love my macbook!!!!
    I also got further problems such as copy-paste not working etc.
    so I fixed it just this morning by running Applejack 1.5 and am back up running noticing your post.
    thanks for helping though!

  • Need to update the list item in the same sharepoint list with particular condition with Sharepoint Designer 2013.

    Hi All
    I have one sharepoint list with huge data i.e with 20columns and more than 200 records with the fields .
    Suppose lets consider there are A,B,C,D,E,F,G,H columns.
    Now i want to create one form with the fields A,C,E.
    When the user enter the existing data of list for columns A,C..based on C value the E column value should change and update that particular item in the list.
    Please guide me without visual web part can we acheive this by Sharepoint designer 2013 or what would be the preferable solution.
    Please help me on this as it is very urgent from me..
    Thanks in Advance
    Sowjanya G

    Hi,
    According to your post, my understanding is that you wanted to update the list item in the same sharepoint list with particular condition with Sharepoint Designer 2013.
    I recommend to create workflow associated to the list and then start the workflow automatically when an item is changed.
    In the workflow, you can add condition and actions as below:
    If current item: C equal to Test1
         Set E to Test2
    Then the value of the filed E will be changed based on the value of the filed C.
    In addition, if you create the form using InfoPath, you can add rule to the filed C as below:
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

Maybe you are looking for

  • Free Goods with Batch Management Activated !!!

    Hi Gurus, I have defined a free goods master data for material on which batch is activated. I have defined the it as with a min of 10 qty 1 free good will be delivered as exclusive item Now as the batch management is active and each batch has 1 qty i

  • Photo Stills look good on the timeline but awful during playback

    Not sure what I did wrong. I'm doing a slideshow of photos and some of the photos look great during playback and some look pixelated. What is the reason behind this? I remember when I did a video the video clips were coming out blurry and I found a "

  • Creating a profile

    Hi, I'm trying to generate a profile. In fact, I would like to define the coordinates of each point  and to automatically generate the graph. Some help will be nice. thanks

  • Change logo in Travel Express template????

    Hello, Does anyone know how to change the logo in the "Travel Express" template. The main template loads the "header" template and teh header template loads a module inside settings called "logo".  This file however is not editable and therefore ther

  • CAREER IN SD / Need Guidance

    Hi Friends, Good day to you, About Me : Am 30 years old MBA (General) Graduate and my UG is BCA. Having 7 years experience in logistics / Freight forwarding industry. Was a super user in SAP - Previous company (SD / MM) (About 2 Years) Now am in non-