Trouble with a data validating loop.

So I tried to make a data validation loop to make sure no single number in an array are the same.
At first I thought it was working fine, but after the sixth test, I noticed I had two of the number "5".
Based on looking at my code, it seems like it could work, but I could not be seeing something significant.
Anyone have any advice or suggestions?
Oh and also, MAX_PICK is a static final int set to 47
picks[0] = randomNumbers.nextInt(MAX_PICK);
picks[1] = randomNumbers.nextInt(MAX_PICK);
picks[2] = randomNumbers.nextInt(MAX_PICK);
picks[3] = randomNumbers.nextInt(MAX_PICK);
picks[4] = randomNumbers.nextInt(MAX_PICK);
while(!valid)
     for(int i=0;i<=4;i++)
         if     (picks[i] == picks[0] ||
              picks[i] == picks[1] ||
              picks[i] == picks[2] ||
              picks[i] == picks[3] ||
              picks[i] == picks[4])
                   picks[i] = randomNumbers.nextInt(MAX_PICK);
         valid = true;
}One thing I just noticed is also, lets say i = 4 and when it compares picks[i] to picks[4] , it will go in the statement anyway, causing it to change picks[4] to another number which could by chance be the same as picks[3]. Is there a way around this? I was thinking about maybe a while loop with the condition the if statement has, but then the loop would run forever. Any insight?
Much Appreciated.

* Created on 2007&#24180;10&#26376;10&#26085;
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
import java.util.*;
public class MyRan {
     static int picks[];
public static void main(String args[]) {
     int MAX_NUM = 5;
     picks = new int[5];
     Random generator2 = new Random( System.currentTimeMillis() );
     //                    picks[j] = generator2.nextInt(MAX_PICK+1);
     System.out.println("======");
     for(int i=0;i<=4;i++)
     picks[i] = generator2.nextInt(MAX_NUM)+1;
     while(!check(picks))        
            for (int i=0; i<5; i++)
                  for (int k=0; k<5; k++)
                        if (i!=k)
                             boolean genSuccess = false;
                             if (picks==picks[k])
                              while (!genSuccess)
                                   picks[k] = generator2.nextInt(MAX_NUM)+1;
                                   if (picks[i]!=picks[k])
                                        genSuccess = true;
     for (int i=0; i<5; i++) {
          System.out.println(picks[i]);
public static boolean check(int input[])
     int duplicateCount = 0;
     for (int i=0; i<input.length; i++)
          for (int k=0; k<input.length; k++)
               if (i!=k)
                    if (input[i]==input[k])
                         duplicateCount++;
     if (duplicateCount>0)
          return false;
     else
          return true;

Similar Messages

  • HT201496 Hai there. I am facing trouble with my garageband apple loops.i don't see apple loops in my browser since quite some time i don't know what has happened to it and how it happened . i just wanted to learn some of basic things about music.can you h

    Hai there. i am having a trouble with the garage band apple loops to get into my macbook pro. . i had it some time back and i dont know where it has gone and how it get it back. is there anyone to help me to get the loops back into the browser . i will be grateful to you if some one can help me with it/ thanks.

    First check, if you do not accidentally have hidden or filtered your loops:
    Uncheck the "Filter for more relevant results" option in the Audio tab of the GarageBand Preferences.
    And the drop down menu on top of the Loop Browser should be set to "Loops", not to some Jam Pack or other collection.
    If you still don't see any loops, check if you have set your project to a special signature, like 9/8, for that no standard loops do exist.
    Then check, if any loops actually are installed in your system Library: Depending on your GarageBand version you should find the standard loops in the Audio folder of your system Library (Application Support > GarageBand):
        Your System Drive > Library > Audio > Apple Loops
    If the Loops are installed, but GarageBand does not show them, you need to rebuild your Apple Loops Index: See the FAQ for how to do it:
    Re-Index GarageBand's Loops
    This requires two steps:
    erase the old Apple Loops Index by deleting everything in
    Your System Drive > Library > Audio > Apple Loops Index
    and then rebuilding the Loops Index by dragging the folder containing all of your loops onto the Loop Browser in GarageBand.
    If no Loops are installed in your Library, you will have to restore them from your Backup.
    Regards
    Léonie

  • Threads in while loop with two data acq loops

    Good day, I am using two while loops to perform data acquisition from two different pieces of hardware inside a "main" while loop - a total of three while loops. I want each of the data acq loops to run as fast as possible. With this model will each data acq loop run in a separate thread or will they be running in the same thread because they are both inside the "main" while loop.
    I'm not getting the performance I would like and I'm looking at ways to optimize the execution. 
    Thanks
    John 

    I would have a loop for each of you data acquisition tasks and at least one, possibly two additional loops that will write your data to file. Let the acquisition loops collect the data as quickly as possible and simply queue it off for further processing. When these loops are in parallel LabVIEW will run them on separate threads. In addition you could have a separate loop with an event structure that could handle you UI interaction. This loop could control the overall application with respect to starting and stopping the tasks, etc. You don't really need to contain all these loops in any other loop or structure. They can all reside on the block diagram next to each other. Ideally you will create subVIs for the data acquision and data processing tasks.
    Message Edited by Mark Yedinak on 10-06-2009 04:29 PM
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • PO Confirmation with Delivery Date Validation Check

    Dear Experts,
    We have requirement in SNC to restrict PO confirmation within a agreed Delivery Date tolerance. This Delivery date validation should work similar to the Quantity validation we have in SAP standard through the PO_ITMUNDERDELIVERY/ PO_ITMOVERDELIVERY validation profiles.
    So the business wants that the Suppliers can only Confirm a PO when the Delivery date in the confirmation is within agreed tolerance (-5 / +1 day ) of the requested delivery date.
    Can you please let us know if there is some standard way through configurations to achieve this. I looked for validation profiles available for delivery date, but could see only for Quantity validations.
    Another option we looked for was to have a Z Table to store this Delivery date tolerance (-5/+1 days), and implement the BAdi /SCMB/BOL_VALFRMWRK to achieve through custom developments.
    Please let me know what solution options we can have for this requirement, as it is urgent.
    Thanks & Regards.
    Shiv.

    Hi Shiv,
    I think there is no need for Z-customization and you can achieve this standard way only thing you have maintained OWN validation:
    After below setting whenever Supplier try to give confirmation which is out side tolerance then system won't allow him to save the confirmation and if supplier is EDI which sends ROC_IN confirmation XML will fail in SNC (You can see that XML in SXI_MONITOR tcode in SNC).
    SPRO>Supply Network Collaboration>Basic Settings> Validation>Own Settings-->Maintain Settings in Validation Profiles
    And maintain below setting
    Profile:POC3
    Val.Check:PO_ACCEPTED_CONF_PUBLISH     
    Status:Active 
    Msg.Type:E(Error )
    Save Mode:DO Not Save message
    Continuation mode:Discontinue checks
    Checked
    Checked
    1-Error
    Profile:POC8
    Val.Check:PO_ACCEPTED_CONF_PUBLISH     
    Status:Active 
    Msg.Type:E(Error )
    Save Mode:DO Not Save message
    Continuation mode:Discontinue checks
    Checked
    Checked
    1-Error
    If you want alert whenever PO confirmation is not within tolerance activate the alert type 7035
    Path:SPRO>Supply Network Collaboration>Exceptions>Alert Type Activation>Activate Alert Types
    Alert type=7035
    History=<Blank>leave this entry blank.
    save this entry.
    If you want receive alert as email then maintain email alert notification:
    See the below link:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/8009bba5-7806-2d10-0b80-fa26d8bcb07c?QuickLink=index&overridelayout=true
    In the above link you need to change alert type from 7051 to 7035.
    Regards,
    Nikhil

  • HT6378 Is anyone havig trouble with the date of uploaded photos?

    I am using iCloud Photo Library since its launch, and I am uploading all of my pictures, even those taken with my DSLR camera. The beta app works fine, but the photos I uploaded are presented with the date different from that one taken. I looked at the time and date of any modification, but even this is different from the date registered on the iCLoud Photo Library. Is anyone having the same problem?

    The uploaded files still contain the original digitized date/time. You can test this by downloading or emailing a photo from iCloud.com or from your iPad/iPhone and then checking the metadata. This is also the case for photos taken on the iPhone or iPad and uploaded to iCloud Photo Library directly. Again, the digitized date/time is correct in the image file.

  • Trouble with database data retrieving!!!Please someone help me!!

    Hello people!!
    I'm havin g a trouble in getting the data from a bean , someone could give me a hand?
    That's the following: The Database class get a conection, a DetalhesLivro.class arraylist
    is obtained with the method getBooks, and I start my servlets apllication with contextListener
    where i staciate this class, so when i retrieving the value the browser keep too long loading
    and give me no data from the class here is piece of code :
    the context:
    package servlets;
    import java.sql.Connection;
    import java.sql.SQLException;
    import javax.servlet.*;
    public final class Contexto implements ServletContextListener{
    private ServletContext context = null;
    public Database db;
    public void contextInitialized(ServletContextEvent event) {
    context = event.getServletContext();
    try {
    db = new Database();
    context.setAttribute("dados", db);
    } catch (Exception ex) {
    System.out.println("Imposs�vel a cria��o do bean:" +
    ex.getMessage());
    public void contextDestroyed(ServletContextEvent event) {
    context = event.getServletContext();
    Database lixo = (Database)context.getAttribute("dados");
    if (lixo != null)
    lixo.remove();
    and this is the class to retrieving the data :
    package servlets;
    import java.io.*;
    import java.sql.SQLException;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Resultado extends HttpServlet {
    DetalhesLivros livro;
    Database db;
    ArrayList livros;
    public void init() throws ServletException {
    db = (Database)getServletContext().getAttribute("dados");
    if (db == null){
    throw new UnavailableException("Couldn't get database.");
    public void destroy() {
    db = null;
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    /* HttpSession session = request.getSession();
    procura = (Procura)session.getAttribute("dados"); */
    response.setContentType("text/html");
    response.setBufferSize(8192);
    String valorRadio = request.getParameter("radio");
    String valorInput = request.getParameter("campo");
    try{
    livros = db.getBooks();
    }catch(Exception e){
    e.getMessage();
    PrintWriter out = response.getWriter();
    // then write the data of the response
    out.println("<html><head><title>Livraria Online!!!</title></head><body><div align=\"center\"><p><strong>"+
    "<p><font size=\"+7\">Loja de Livros</font></p>");
    Iterator iterator = livros.iterator();
    try{
    while(iterator.hasNext()){
    if(valorRadio=="titulo"){
    livro = (DetalhesLivros)iterator.next();
    if(livro.getTitulo()==valorInput){         
    out.println("<p> </p><p><strong>Nome do Livro:"+livro.titulo+
    "</strong></p><p><strong>Autor:"+livro.autor+"</strong></p><p><strong>Pre&ccedil;o:"+livro.getPreco()+"</strong>"+
    "</p><p><strong>C&oacute;digo:"+livro.getCod()+"</strong></p>");
    break;
    break;
    }catch(Exception e){
    e.getMessage();
    out.println("<p></p><br><br><br><table width=\"48%\" border=\"0\"><tr><td width=\"60%\"><a href=\"\"><strong>Pesquisar</strong>"+
    "</a></td><td width=\"40%\"><a href=\"\"><strong>Listar</strong></a></td></tr></table><strong>"+
    "</strong></div></body></html>");
    out.close();
    thanks a lot for some help!!!

    sorry!!
    package servlets;
    import java.sql.Connection;
    import java.sql.SQLException;
    import javax.servlet.*;
    public final class Contexto implements ServletContextListener{
        private ServletContext context = null;
        public Database db;  
        public void contextInitialized(ServletContextEvent event) {
            context = event.getServletContext();             
            try {
                  db = new Database();
                  context.setAttribute("dados", db);
            } catch (Exception ex) {
                System.out.println("Imposs�vel a cria��o do bean:" +
                    ex.getMessage());
        public void contextDestroyed(ServletContextEvent event) {
            context = event.getServletContext();
            Database lixo = (Database)context.getAttribute("dados");
            if (lixo != null)            
                   lixo.remove();                     
    }package servlets;
    import java.io.*;
    import java.sql.SQLException;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Resultado extends HttpServlet {
    DetalhesLivros livro;
    Database db;
    ArrayList livros;
    public void init() throws ServletException {
    db = (Database)getServletContext().getAttribute("dados");
    if (db == null){
    throw new UnavailableException("Couldn't get database.");
    public void destroy() {
    db = null;
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    /* HttpSession session = request.getSession();
    procura = (Procura)session.getAttribute("dados"); */
    response.setContentType("text/html");
    response.setBufferSize(8192);
    String valorRadio = request.getParameter("radio");
    String valorInput = request.getParameter("campo");
    try{
    livros = db.getBooks();
    }catch(Exception e){
    e.getMessage();
    PrintWriter out = response.getWriter();
    // then write the data of the response
    out.println("<html><head><title>Livraria Online!!!</title></head><body><div align=\"center\"><p><strong>"+
    "<p><font size=\"+7\">Loja de Livros</font></p>");
    Iterator iterator = livros.iterator();
    try{
    while(iterator.hasNext()){
    if(valorRadio=="titulo"){
    livro = (DetalhesLivros)iterator.next();
    if(livro.getTitulo()==valorInput){         
    out.println("<p> </p><p><strong>Nome do Livro:"+livro.titulo+
    "</strong></p><p><strong>Autor:"+livro.autor+"</strong></p><p><strong>Pre&ccedil;o:"+livro.getPreco()+"</strong>"+
    "</p><p><strong>C&oacute;digo:"+livro.getCod()+"</strong></p>");
    break;
    break;
    }catch(Exception e){
    e.getMessage();
    out.println("<p></p><br><br><br><table width=\"48%\" border=\"0\"><tr><td width=\"60%\"><a href=\"\"><strong>Pesquisar</strong>"+
    "</a></td><td width=\"40%\"><a href=\"\"><strong>Listar</strong></a></td></tr></table><strong>"+
    "</strong></div></body></html>");
    out.close();
    --------------------------------------------------------------------------------------------

  • Trouble with saving data with 1 to 0..1 relation

    I have following simple data model: a parent entity which has 2 relations to 2 child entities called ChildA en ChildB. The type of relation is 1 to 0..1.
    I have a (saved) record which has only a childA relation and execute following code (with button when record is shown):
    screen.Parent.ChildA.deleteEntity();
    screen.Parent.setChildB(new myapp.ChildB);
    screen.Parent.ChildB.BProp1 = "test";
    screen.Parent.ChildB.BProp2 = "test";
    screen.Parent.ChildB.BProp3 = "test";
    screen.Parent.ChildB.deleteEntity();
    screen.Parent.setChildA(new myapp.ChildA);
    screen.Parent.ChildA.AProp1 = "final";
    screen.Parent.ChildA.AProp2 = "final";
    When I hit save afterwards, I get:
    What am I doing wrong?
    This is what's going over the wire:
    --batch_1c90-fa5c-f201
    Content-Type: multipart/mixed; boundary=changeset_0c72-4e38-ea49
    --changeset_0c72-4e38-ea49
    Content-Type: application/http
    Content-Transfer-Encoding: binary
    POST ChildAs HTTP/1.1
    Content-ID: 1
    DataServiceVersion: 3.0
    Accept: application/atomsvc+xml;q=0.8, application/json;odata=fullmetadata;q=0.7, application/json;q=0.5, */*;q=0.1
    Content-Type: application/json;odata=verbose
    MaxDataServiceVersion: 3.0
    {"AProp1":"final","AProp2":"final"}
    --changeset_0c72-4e38-ea49
    Content-Type: application/http
    Content-Transfer-Encoding: binary
    MERGE Parents(13) HTTP/1.1
    Content-ID: 0
    DataServiceVersion: 3.0
    If-Match: W/"X'000000000000273C'"
    Prefer: return-content
    Accept: application/atomsvc+xml;q=0.8, application/json;odata=fullmetadata;q=0.7, application/json;q=0.5, */*;q=0.1
    Content-Type: application/json;odata=verbose
    MaxDataServiceVersion: 3.0
    {"ChildA":{"__metadata":{"uri":"$1"}}}
    --changeset_0c72-4e38-ea49
    Content-Type: application/http
    Content-Transfer-Encoding: binary
    DELETE ChildAs(13) HTTP/1.1
    Content-ID: 2
    DataServiceVersion: 3.0
    If-Match: W/"X'000000000000273D'"
    Accept: application/atomsvc+xml;q=0.8, application/json;odata=fullmetadata;q=0.7, application/json;q=0.5, */*;q=0.1
    MaxDataServiceVersion: 3.0
    --changeset_0c72-4e38-ea49
    Content-Type: application/http
    Content-Transfer-Encoding: binary
    DELETE Parents(13)/$links/ChildB HTTP/1.1
    Accept: application/atomsvc+xml;q=0.8, application/json;odata=fullmetadata;q=0.7, application/json;q=0.5, */*;q=0.1
    MaxDataServiceVersion: 3.0
    --changeset_0c72-4e38-ea49--
    --batch_1c90-fa5c-f201--
    paul van bladel ==independent enterprise application architect== http://blog.pragmaswitch.com

    Hi Paul,
    It is unusual for you to be posting a question you normally answer them :)
    I decided to run some tests based on your example out of curiosity.
    I got to test 'C' here is a workaround but crucially also not a single transaction.
    myapp.AddEditParent1.TestEditC_execute = function (screen) {
    var parent = screen.Parent,
    child = parent.ChildA;
    child.deleteEntity();
    screen.details.dataWorkspace.ApplicationData.saveChanges()
    .then(function (res) {
    var childA = new myapp.ChildA();
    childA.AProp1 = "final-C";
    childA.AProp2 = "final-C";
    childA.AProp3 = "final-C";
    parent.setChildA(childA);
    That got me thinking that actually the result of you code is an update in the end really ;)
    myapp.AddEditParent1.TestEditD_execute = function (screen) {
    screen.Parent.ChildA.AProp1 = "final-D";
    screen.Parent.ChildA.AProp2 = "final-D";
    screen.Parent.ChildA.AProp3 = "final-D";
    So that was test D which obviously worked!
    I think it is a bug.
    Cheers
    Dave
    Dave Baker | AIDE for LightSwitch | Xpert360 blog | twitter : @xpert360 | Xpert360 website | Opinions are my own. For better forums, remember to mark posts as helpful/answer.

  • Trouble with generic data source

    Dear Gurus,
    I've created a generic data sources using tx. rso2, based on the view ZTV_CONFLO, that is created based on two tables: ZTB_CONFLO and MSEG, there comes the problem. My table ZTB_CONFLO has 500 registries, and I'm using MSEG table in my view just to avoid problem with units, anyway, when I check to see the registries in the view there are muy 500 entries multiplied by the number of entries in MSEG table.
    Please how can I solve this problem, it is urgent.
    Best regards,
    Pilar Infantas.

    Pilar,
      1. Create a View on table ZTB_CONFLO.
      2. Select all required fields except PESCA(wht ever key figures giving problem).
      3. Create a Datasource using View created in the above Step.
      4. Enahnce Datasource from RSA6 by selecting DS in RSA6(Append Datasource).
      5. System will propose one technical name. Accept the Name. Press Enter.Provide the Description for Structure.
      6. Provide the Quntity and Unit Fields.
    Fields Name ZZECSCA "Provide DataElement from MSEG for any Quantity field
    ZZMEINS                   MEINS
    7. Save and Activate the Structure.
    8. Create user Exit to poopulate the Data through User Exit.
    Please check forum for User exit coding Tips. Let me know if you have any Questions.
    all the best.
    Regards,
    Nagesh Ganisetti.
    Assign points if it helps.

  • Trouble with sql dates getting Monday of this week

    Hi
    How do I get the Monday of this week. I am using:
    <code>next_day(trunc(sysdate,'DAY'),'Monday')</code>
    but get the coming Monday. Initially this code was working before apex was upgraded from 3.0 to 3.1.
    Why would this stop working.
    But if I was to use
    <code>next_day(trunc(sysdate,'DAY'-7),'Monday')</code>
    thanks
    Tony

    Hi Scott
    thats what I thought but I was not getting the present week's Monday. I am trying to get the Sunday and Monday of the present week so have had to put a
    -7 next to the sysdate.
    The Application I have been using was running in but when there was an upgrade to apex 3.1 then the returned dates have not been correct.
    thanks
    Tony

  • Trouble with increased data usage since 5.1 update

    Since updating my iPhone4 to 5.1 I seem to be using much more data. My phone will show that it's on WiFi...and my ATT phone bill is showing data charges at the same time. Does anyone know a solution to this problem? It is happening on all 3 of the iPhones I own.

    I am also having the exact same problem.

  • Having trouble with cgicmd.dat

    This is my keymap in cgicmd:
    order_test: userid=user/pw@database report=ord_ack.rdf destype=cache desformat=PDF a_seq_order_no=%1 a_user=%2 a_by_user=%3 a_print_kit=%4 a_rpt_name=%5
    this is my URL:
    http://65.215.11.54:7778/reports/rwservlet?order_test&&14094&&B_USER&&C_USER&&Y&&P
    (I masked some info for security obviously)
    All I'm getting is a blank report... am I passing the parameters correctly?
    This worked fine in OAS 10g (9.0.4), but when I use the same code in OAS 10gR2.. it doesn't work. anyone able to help?
    Thanks,
    Scott

    Hi,
    what happens if you run it as follows?
    e.g
    http://65.215.11.54:7778/reports/rwservlet?order_test&14094&B_USER&C_USER&Y&P
    ** Noted that I removed the double & sign
    Hope it helps.

  • Trouble with date

    I have some trouble with the date system on my laptop.  Everything is correct on the System Preferences thing.  but when I watch info on a document (e.g. cmd/i) files are registered with dates like 15.6.0034 or 18.5.1119 (Norwegian calendar system dd.mm.yyyy).
    I just registered a test person in the Address book, and it showed 18.5.1120, which is  - in fact - many hundred years back in time!  Ihave done what is called PRAM, and I have run disk utility (verify and repair), but test persons and files are still registered in the year 1120. If I'm lucky I'll manage to get a screen picture here to show you.
    When I use Pages and things, dates are shown correctly, but it is quite annoying not to know when files were registered or updated.
    But I'm sure some of you clever guys will be able to help me! 

    jsa1307 wrote:
    What about this: Whenever I boot into Windows using Boot Camp the date & time is screwed up when I boot back into Leopard. I've tried trashing the localtime file and turning on/off the network time server. Nothing works as a permanent fix. Will I have to reset the time manually every time I change operating systems ??
    If you were to check into the BootCamp forum you would find your answer. It's a common question.
    http://discussions.apple.com/forum.jspa?forumID=1244
    Your issue here is unrelated to that of the original poster and should be reposted in the BootCamp forum.
    Thanks.

  • Having trouble with garageband loops are out of time with other loops

    having trouble with garageband have bought loops from primeloops and beat loops are not in time when i paste other loops down for example certain loops do not lock into measure region correctly .. so say for instance i lay down my beat then i try to add hi hat below and the beat is not in time with hi hat any awnsers may have pressed some setting accidently because this hasn t happened before as previously using these loops were all in time and locked at correct measures ..

    The GarageBand experts await you here:
    https://discussions.apple.com/community/ilife/garageband

  • I'm having trouble with a multi channel acquisition and download with PXI-5922

    I am having trouble with getting data out from both channels of a PXI-5922.  My software seems to be working, but when I do the fetch there is no data for the second channel.  I am using the same format for all of the channelList inputs (0,1).  I've checked the instrument handles and anything else I can think of, but this is my first time trying to collect data on 2 channels of a digitizer.  Any help would be appreciated.

    Hi schliepe,
    Try checking your code against an existing example. The
    Developer Zone Example: Independent
    Channel Configuration with NI-SCOPE is a good VI to reference. Also note
    that there are several examples that come with the NI-SCOPE driver. They can be
    found in Windows by going to Start »
    Programs » National Instruments » NI SCOPE » Examples. Additionally, if you find that the examples are not working either, verify that both channels are functioning by running the
    NI-SCOPE Soft Front Panel.
    Please post back if you have any questions. Have a great
    day!
    Ryan D.
    District Sales Manager for Boston & Northern New England
    National Instruments

  • Problem with filtering data

    Hi!
    I'm having trouble with filtering data from my table and don't know how to resolve it properly.
    I created a tabular form my table, a few text fields that are used as input for different columns of the filter and a filter button that submits the page.
    The problem appeared when I try to filter a column that has null values in the table and is editable...that's as far as I have concluded.
    So when I press the button I get zero rows even though there should be some.
    This is the submitted query:
    select
    "MSR_PRD_ID",
    "SRC_STM_ID",
    "ID",
    "ISIN",
    from "#OWNER#"."IZV_SLOG_DET"
    WHERE
    lower(MSR_PRD_ID) = lower(nvl(:P7_X_MSR_PRD_ID,MSR_PRD_ID)) and
    lower(SRC_STM_ID) = lower(nvl(:P7_X_SRC_STM_ID,SRC_STM_ID)) and
    lower(ISIN) = lower(nvl(:P7_X_ISIN,ISIN)) and
    The nvl function is used so that if the user leaves the field empty it only filters by the fields that have input.
    Does anyone know how I could circumvent this?
    Regards,
    Ivan

    LOWER (NVL (ISIN,'Y')) = LOWER (NVL (:P7_X_ISIN, LOWER (NVL (ISIN,'Y'))))
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    https://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494

Maybe you are looking for

  • Error while running java code

    Hi I have requirement of converting word document to PDF/A. Iam using the APIs provided by Livecycle ES. I tried to implement the requirement by creating a java program with the jar files provided. But iam getting the following error. Can anyone plz

  • Since installing Airport Express wireless connection to other devices keeps being dropped

    Our home network consists of my MacBook Pro 15", my wife's quite old Compaq notebook, an Apple TV, and recently, an Airport Express. The router is one that was provided by our ISP, Alice/O2 in Germany. I think it is made by Siemens but its model name

  • Certificates

    I'm using the latest (as of today) Java Studio Enterprise 8.1 application server. I'm trying to request a verisign certificate and install it on the system. I used the keytool to perform a certificate request, sent the certificate to versign, got the

  • WIndows 8.1 Speaker volume not working Revolve 810...

    Hello guys i have a Revolve 810 G2 Elitebook running on windows 8.1 . It seems that my native speakers on my laptop won't work when I am in a skype call but when I plug in my headphones the work just fine. I tried going into the playback options and

  • Error 0xd0840001 when printing

    My wife has a HP Office Jet 5610 All-In-One. She's hooked up using usb to a Dell 32-bit machine running Vista Ultimate. On a regular basis, she gets the message "Error 0xd0840001" when printing a document. Often, the majority fo the first page has al