A simple IF condition question????

Hi guys...
I have a short question???
I am faced with two conditons of the form:
If(a && b && C){
do something
}else
if(a && b && c && d){
do something else
the problem I am getting is that the first condition is executed on both cases.
is there any other way to make a stronger difference between the two conditions discribed above???
thanks...

Well, once the any conditional part of an if/else if/else statement is reached, the rest of the conditionals for any further else if's or else's are ignored on the understanding that all conditions should be mutually exclusive.
In your case, your first condition says nothing about the outcome of d, only that a, b, and c must be true. If the first condition requires that D must not be true, then you can use something like...
if(a && b && c)
   if(!d)
      //do something
   else
      //do something else
}Otherwise, if the first condition has no relation to d, and you want both to enter both blocks if a, b, c and d are true, then you need to give them separate IF blocks..
if(a && b && c)
   //do something
if(a && b && c && d)
   //do something else

Similar Messages

  • RE: possible glitch with conditional questions

    I've been designing a form with mulitple conditional questions. On testing, a 'glitch' seems to be occuring. If i     a) check and answer to a question which leads to a secondary conditional question, and then b) check a response in that conditional question, and then c) change the response to the original question, the response to the conditional second question remains. i think this may be due to the fact that once you check an answer in a single choice question, you cannot "unanswer" or uncheck the whole question, that is you cant "remove" the check all together.
    Any workarounds?

    I'm not quite sure I understand. Can you create a simple form illustrating the issue and send it to me. Please enumerate the exact steps that cause the issue.
    Thanks for the clarification.
    Randy

  • Simple OR condition..but getting prob

    Hi all,
    Please help me
    I am trying to use simple OR condition in a where clause
    here is my script
    Select * from table 1
    where is_numeric(acct_no) = 0 --- is_numeric is function which returns 0 for non digit acc no
    or
    count_no in ( select count_no from table 1
    minus
    select count_no from table2)
    i dont knw why query is taking a long long time to run w/o out put itired to put braket also but didnt worked.
    i knw we can use union too but i dont want to use that.
    please help me ....
    Thanks
    Edited by: user10647455 on Dec 3, 2008 8:04 AM

    Hi,
    Like Jortri, I would use EXISTS.
    I suspect this way is faster:
    Select  *
    from    table1
    where   is_numeric (acct_no) = 0 --- is_numeric is function which returns 0 for non digit acc no
    or      NOT EXISTS
            (   select  NULL
                from    table2
                where   count_no = t1.count_no
            );There's no need to reference table1 in the sub-query. You already know count_no exists in table1: that's where you got it.
    Calling the PL/SQL function is taking considerable time. If you're only checking for simple types of numbers (such as unsigned integers) you can do that a lot quicker using SQL, especially regular expressions, as Blushadow and Michaels showed you in [your previous thread|http://forums.oracle.com/forums/message.jspa?messageID=3155232#3155232]. If you need to check for any possible number (such as '+1.4E-5') then you probably do need a function. The function may be faster if it is declared as DETEMINISTIC.
    Edited by: Frank Kulash on Dec 4, 2008 1:03 PM

  • Simple compare condition fails [Solved: Bug 4619731]

    Edit: I have found the root of the problem, and Simple compare condition fails [Solved: Bug 4619731]. I have opened a Service Request 7045745.993 on the problem.
    Original text:
    I have encountered the most bizarre bug today. An associate is trying to debug a 1900 line package that was NOT terminating a loop properly.
    The package has the code:
        Exit when x <> y;where x and y are VARCHAR2(8) variables.
    The problem is that even though the values were UNequal, the loop never ended. We added dbms_output debugging code to display x and y, and we could easily see that their values were NOT equal.
    For instance, one was 19824E1A and the other was 19824E2A. Or one was 19824E1A while the other was 99999999.
    I even added a block of code re-testing the condition like this:
      If x <> y then
        dbms_output.put_line(x||'<>'||y);
      Else
        dbms_output.put_line(x||'='||y);
      End if;But no matter what the values of x and y, it always reported them equal.
    I found two workarounds:
    1. concatenate a character (I used a period) to the end of each variable in the condition.
        Exit when x||'.' <> y||'.'2. Or, add an anonymous block before or after the Exit when..., such as:
    Declare
      v varchar2(2);
    Begin
      v := 'AB';
    End;Curiously, when I replaced the v := 'AB'; with NULL;, the bug came back.
    This bug occurs on Oracle Database 10g Enterprise Edition Release 10.2.0.3.0
    I am not sure where to start to try to solve or report this problem. It pretty much destabilizes the entire PL/SQL programming foundation for all our packages. It leaves me wondering where else the code may be failing.
    Has anyone seen something like this reported before?
    Edited by: Steve Cosner on Aug 27, 2008 10:05 PM

    No offense taken, SY. I was just trying to express how aware I am of the issue of comparing null values in condition statements.
    All I can do here is underscore that it is not an issue with null values. The problem is with the statement in the first line. To prove that it was not null values, I coded the second line following the first:
        exit when x <> y;
        dbms_output.put_line('x='||x ||' and y='||y);The output from the run showed in the first pass through the loop, x and y were equal and were not null. So the process ran correctly that time. But in subsequent passes through the loop, they were NOT equal and were not null, but the debugging code was executed.
    There is no way the values were null.
    I certainly wondered about the null issue when I concatenated a character to the variables in the conditional test. But my debugging lines first confirmed that they were not null. I suspect more that the bug has something to do with the size of the package and the variables being exactly eight characters, which is 64 bits, which has special significance in many computer languages.
    Regarding your concern of the variable names and scope issues, the actual variable names in the actual code can be seen below (I just used x and y for simplicity within this thread):
        LOOP
          EXIT WHEN V_LAST_PERIOD <>
              SIPK0003.COURSE_ADJUST_REC.ACAD_REC_PERIODwhile the silly anonymous block that caused the process to work, using the variable named v, was the actual code. There is no way we use simple one-character variable names in a 1900 line package. There is no way the scope of variable V extended outside the embedded anonymous block. My point was that somehow, changing the size of the compiled package object, or at least the size of the code generated for the loop process caused the package to run correctly. In fact, thinking about the
    Declare V... Begin Null; End; sequence, I'll bet the PL/SQL compiler is sharp enough to notice that it was a do-nothing block, so never included it in the compiled object. As soon as I assigned V a value, the code WAS included, so the size of the generated code for the loop changed, and somehow, that caused it to run correctly.
    Regarding the use of the package.record.column value above, we even copied the value to a local variable, and then used the local variable in the Exit When statement. Doing that made no difference.

  • Simple X-fi Question, Please Help

    !Simple X-fi Question, Please HelpL I've been looking for an external sound card that is similar to the 2002 Creative Extigy and think I may found it in the Creative X-Fi. I have some questions about the X-fi though. Can the X-fi:
    1. Input sound from an optical port
    2. Output that sound to 5. surround- Front, surround, center/sub
    3. Is the X-Fi stand-alone, external, and powered by a USB or a wall outlet (you do not need a computer hooked up to it)
    Basically I want to connect a TosLink optical cable from my Xbox to the X-Fi. That will deli'ver the sound to the X-Fi. Then I want that sound to go to a 5. headset that is connected to the X-fi via 5. front, surround, and center/sub wires. The X-Fi has to be stand-alone and cannot be connected to a PC to do this.
    Thank you for your help.

    The connector must match, and the connector polarity (plus and minus voltage) must match.  Sorry, I don't know if the positive voltage goes on the inside of the connector or the outside.    Any wattage of 12 or more should be adequate.
    Message Edited by toomanydonuts on 01-10-2008 01:29 AM

  • Simple Crop tool question... how do I save the crop section?

    Hi,
    I have a very simple crop tool question. I'm a photoshop girl usually... so Illustrator is new to me. When I select the crop section I want... how do I save it?... if I select another tool in the tool panel, the crop section disappears and I can't get it back when I re-select Crop tool. If I select Save as... it saves the whole document...and not just my crop section.
    Like I said, simple question...but I just don't know the secret to the Illustrator crop tool.
    Thanks!
    Yzza

    Either press the Tab key or F key.

  • A Simpler, More Direct Question About Merge Joins

    This thread is related to Merge Joins Should Be Faster and Merge Join but asks a simpler, more direct question:
    Why does merge sort join choose to sort data that is already sorted? Here are some Explain query plans to illustrate my point.
    SQL> EXPLAIN PLAN FOR
      2  SELECT * FROM spoTriples ORDER BY s;
    PLAN_TABLE_OUTPUT
    |   0 | SELECT STATEMENT |              |   998K|    35M|  5311   (1)| 00:01:04|
    |   1 |  INDEX FULL SCAN | PKSPOTRIPLES |   998K|    35M|  5311   (1)| 00:01:04|
    ---------------------------------------------------------------------------------Notice that the plan does not involve a SORT operation. This is because spoTriples is an Index-Organized Table on the primary key index of (s,p,o), which contains all of the columns in the table. This means the table is already sorted on s, which is the column in the ORDER BY clause. The optimizer is taking advantage of the fact that the table is already sorted, which it should.
    Now look at this plan:
    SQL> EXPLAIN PLAN FOR
      2  SELECT /*+ USE_MERGE(t1 t2) */ t1.s, t2.s
      3  FROM spoTriples t1, spoTriples t2
      4  WHERE t1.s = t2.s;
    Explained.
    PLAN_TABLE_OUTPUT
    |   0 | SELECT STATEMENT       |              |    11M|   297M|       | 13019 (6)| 00:02:37 |
    |   1 |  MERGE JOIN            |              |    11M|   297M|       | 13019 (6)| 00:02:37 |
    |   2 |   SORT JOIN            |              |   998K|    12M|    38M|  6389 (4)| 00:01:17 |
    |   3 |    INDEX FAST FULL SCAN| PKSPOTRIPLES |   998K|    12M|       |  1460 (3)| 00:00:18 |
    |*  4 |   SORT JOIN            |              |   998K|    12M|    38M|  6389 (4)| 00:01:17 |
    |   5 |    INDEX FAST FULL SCAN| PKSPOTRIPLES |   998K|    12M|       |  1460 (3)| 00:00:18 |
    Predicate Information (identified by operation id):
       4 - access("T1"."S"="T2"."S")
           filter("T1"."S"="T2"."S")I'm doing a self join on the column by which the table is sorted. I'm using a hint to force a merge join, but despite the data already being sorted, the optimizer insists on sorting each instance of spoTriples before doing the merge join. The sort should be unnecessary for the same reason that it is unnecessary in the case with the ORDER BY above.
    Is there anyway to make Oracle be aware of and take advantage of the fact that it doesn't have to sort this data before merge joining it?

    Licensing questions are best addressed by visiting the Oracle store, or contacting a salesrep in your area
    But I doubt you can redistribute the product if you aren't licensed yourself.
    Question 3 and 4 have obvious answers
    3: Even if you could this is illegal
    4: if tnsping is not included in the client, tnsping is not included in the client, and there will be no replacement.
    Tnsping only establishes whether a listener is running and shouldn't be called from an application
    Sybrand Bakker
    Senior Oracle DBA

  • Simple Java SDK question for server group assignment

    I have a snippet of code below in which I am trying to apply the setProcessingServerGroup() and setProcessingServerGroupChoice() methods to my report object. My question should be relatively simple: I believe I need to cast(?) my iObject report object to iProcessingServerGroupInfo per the API in order to use the setProcessingServerGroup() and setProcessingServerGroupChoice() methods, but I'm not sure how to do so.
    Can someone please advise how to cast my iObject to iProcessingServerGroupInfo?
    Thanks in advance...
    Code:
    IInfoObject iObject = (IInfoObject) childReports.get(i); 
    int sgID_view = Integer.parseInt(serverGroupID_view);
    int sgPref_view = Integer.parseInt(serverGroupPref_view);
    !!!!!  CONVERSION / CAST NEEDED HERE !!!!!
    iProcessingServerGroupInfo.setProcessingServerGroup(sgID_view);
    iProcessingServerGroupInfo.setProcessingServerGroupChoice(sgPref_view);

    To followup, I've been able to cast to IShedulingInfo in order to use the setServerGroup() and setServerGroupChoice() methods successfully:
    IInfoObject iObject = (IInfoObject) iObjects.get(i);    
    ISchedulingInfo iSchedulingInfo = iObject.getSchedulingInfo();
    iSchedulingInfo.setServerGroup(427);
    iSchedulingInfo.setServerGroupChoice(2);
    But I don't know how to perform the cast to be able to access the setProcessingServerGroup(), sterProcessingServerGroupChoice() methods.
    Any help appreciated.
    Thanks!

  • Simple java architecture question

    This should be a simple question to answer but I haven't been able to find a good answer.
    I have an application that establishes a network connection with a server and registers event listeners on that connection.
    What I want to do is find a way without a busy-wait/while loop to keep the main() thread running so that the listeners can do their job.
    Here is a sample of what I've got:
    public static void main(String[] args)
    SomeConnection conn1 = null;
    try
    conn1 = new SomeConnection("someaddress");
    TrafficManager tm = conn1.getTraffictManager();
    TrafficHandler th = tm.createTraffichandler(new MessageListener()
                        public void processMessage(Message message)
                             System.out.println("Received: " + message.toString());
         catch (Exception e)
              e.printStackTrace(System.out);
         conn1.disconnect();
    The problem is that the application doesn't stay running to respond to traffic coming across the connection.
    Any guidance would be appreciated.
    Thanks

    Well, what is the job of the MessageListener if it isn't to listen for messages? And apparently it isn't doing that because your application terminates.
    Bear in mind that I don't have any idea how any of those four classes work, or even how they are supposed to work. So let me just quote this line from the API documentation of the Thread class which says when your application will terminate:
    "All threads that are not daemon threads have died, either by returning from the call to the run method or by throwing an exception that propagates beyond the run method."
    That must be the case in your application.

  • Simple Java Coding Question

    I know this is a simple question, but I can't search for the answer to this because it involves syntax that Google and the like don't seem to search for..
    I am trying to figure out some Java code that I have found. I would like to know what:
    a[--i] and a[++j] mean.
    My first thought was that they meant to look at the position in the array one less (or more) than i (j). But that doesn't seem to be the case. A is an array of Strings, if that matters...
    Thanks for you help.

    muiajc wrote:
    I know this is a simple question, but I can't search for the answer to this because it involves syntax that Google and the like don't seem to search for..
    I am trying to figure out some Java code that I have found. I would like to know what:
    a[--i] and a[++j] mean.
    It mean increase/decrease the int i/j by 1. This is done before it gets you the value of a[]. for example if i=5 and you said a[--i] it is really a[4] and i is now equal to 4;

  • Simple Java EJB question.

    When it comes to EJB v3 Remote and Local interfaces,
    (With JBoss EJB Container Software in mind, for this question,)
    -Does the Remote interface for the EJB include method signatures from the Bean class
    -that are to be seen
    -that are to be hidden?
    -Does the Local interface for the EJB include method signatures from the Bean class
    -that are to be seen
    -that are to be hidden?
    Which is which for
    -EJB 2.1 ?
    -EJB 3.x ?
    - is EJB 3.x reverse compatible in that it allows use of the javax.ejb.* interfaces,
    and would accept a EJB 2.1 approach, or does it force one to use Annotations
    exclusively?
    Edited by: Zac1234 on Jul 21, 2010 5:21 PM

    muiajc wrote:
    I know this is a simple question, but I can't search for the answer to this because it involves syntax that Google and the like don't seem to search for..
    I am trying to figure out some Java code that I have found. I would like to know what:
    a[--i] and a[++j] mean.
    It mean increase/decrease the int i/j by 1. This is done before it gets you the value of a[]. for example if i=5 and you said a[--i] it is really a[4] and i is now equal to 4;

  • A few simple (?) dimension questions...

    Hi, I have a few really simple dimension questions that I just can't figure out in OWB (which I'm just now starting to play with):
    1) I'm trying to create a dimension that has no levels or any hierarchy. In the BI tool, I just want this dimension to act as a "pick list" for one of 8 values (DW data snapshot dates for the last 8 weeks...) Users won't summarize by this dimension, or ever have more than 1 week selected at a time. How can I set this type of dimension up?
    2) Somewhat related to #1 - just to get something working, I set up a "time in weeks" dimension not as a time dimension, just as a normal user dimension. I then added a single "weeks" level with a surrogate key (using "key" instead of "id"), short desc (as the business key), and long description. Set up a mapping from my source table, everything worked fine. The strange thing I've notcied is that the relational table produced has both a "week_key" column and a "dimension_key" column. How can I get rid of the "dimension_key" column - its just an exact duplicate of the lowest level key column? Note - we will have a dimension table with over 1.3 BILLION rows in our warehouse - so duplicating this column does add a significant amount of overhead - this isn't just an academic problem.
    3) related to building this "test" dimension - my source table has 8 records in it. Whenever I run the ETL to populate the dimension table, the surrogate keys end up being key values 9 - 16 instead of 1 - 8. Note this is even if I reset the sequence number to 1 before I start, etc. My understanding is that Oracle uses a variable width number field when storing data - so having this dimension with values 1-8 instead of 9-16 saves approx a byte for every fact table record (which we're predicting will be in the range of 20 - 50 BILLION rows). How can I force the dimension to start numbering at 1?
    Thanks in advance,
    Scott

    Hi
    Reg #2, I do not think we can get rid of the "dimension key". It looks like OWB is creating this column as a default Primary Key and hence is not possible to remove this. May be if we build the base Table for dimension as a normal relational table, which will allow us to define our own keys, and then build the "Dimension" using AWM on this relation table may resolve the issue of having duplicate primary keys. Its only a thougt, have not tested though.
    rgds
    Mahesh

  • Ridiculously simple audio editing question for Garage Band

    Ok, so this is really a fundamental
    question. It concerns editing technique.
    In analog mixing, the editor put
    the sounds to be saved in the right
    places on each of several tracks --
    narration, sound effects, lip sync,
    music, etc. The tracks were then
    all locked together and the mixer
    adjusted the volumes to either save
    or reject audio information.
    A blank master received the information
    and that was your final product,
    in sync, sprocket by sprocket, with
    the video.
    My question, then, is, how do you
    do it in digital multitrack such as
    Garage Band? Are you aiming to have
    4 or 5 tracks all level controlled
    or do you simple erase unwanted
    sound, or what exactly do you do,
    in post production? If you are going
    to do a voice over, then you have to
    do a mix at some point, not just a
    cut and paste. What's the philosophy,
    if you don't mind my asking?
    Thanks,
    Ed

    Wow... you gave me flashbacks to a movie soundtrack I scored, with separate reels of tape all synced up and whirling away for final mixdown!
    To answer your question as best I can in a paragraph or two, digital mixing is unlimited compared to analog. Whereas tape has a physical limit, you can always add another digital track (there are limitations to digital, but they are becoming harder to reach as systems become increasingly powerful). So no need to erase. Editing is also a breeze. Digital tracks are endlessly malleable, with virtually every parameter available for automation.
    Sometimes you might mix down to stems or mix everything down to a stereo master (or alternative mixes) for post production. Similarly, in post, they can deal with huge numbers of digital tracks from different sources.
    In terms of a professional workflow, Logic is the more typical choice over Garageband, and includes a number of features designed for scoring to picture: variable sample rates, frame rates, etc.
    Gain staging in digital recording is different than in analog, and it requires a different approach to achieve excellent sounding results. But the digital workflow is so much more flexible, forgiving, and economical, that it has been the death-knell for the analog workflow. Infinite bussing, routing, mixing, comping, storing, stemming... infinite possibilities, really!

  • Simple Library Import question

    I have a simple question pertaining to importing. I am used to iPhoto where you import all pictures into your "Library" folder. However in Aperture I find that I can import into the "Library" (which in turn also puts the picture in a "Project") and also import directly into a Project which sometimes doesn't seem to include the pictures in the Library.
    My confusion is what is the point of Library then if you can import into a project? (or have I done something wrong during an import?)
    Thanks in advance!

    An image is always in exactly one project. All the images in all projects are in the library. (Folders and albums are a little more complicated, holding pointers to images, not images.)
    Highlighting "Library" in the projects panel doesn't show anything (usually). If you highlight the All Images blue Smart Album under Library, it will show all the images in all projects. If that doesn't seem to be the case, it's probably because you're filtering images. Select "Show All" in the search box at the upper right corner of the Browser. It's easy to forget this, and panic because all or most of your images seem to have disappeared.

  • Simple Design Analysis Question before designing dimensions and facts

    Hi I have a simple question ... (I think its simple)
    Suppose that i have the following staging table with the following columns:
    Student_Name | RollNo | Test_Date | Subject-Taken
    with data such as
    Kevin |123|12-4-2010|Physics
    now suppose that I want to design a cube on the basis of the above table so that I can succesfully get the result of a query such as
    List the names of all those students who took the test b/w 12-4-2010 to 12-5-2010 of the Subject Physics
    Here what i need to know what dimensions/Levels would u set and what would be our fact?
    I think that one dimension would be time ( but i am not sure how i would  accommodate and handle duration... any idea )
    would it be wise to make each column a dimension ??? for example the student_nanme a dimension and details of the student its attributes??
    Anyways the main thing is what bothers me is looking at the query we see that we are required 3 things the name of the student , the TestDate and subject taken so if i make the 3 columns the  dimension i am still not sure that i would be able to acomodate the query properly...any ideas on how to approach and handle these situations
    Edited by: Johnacandy on Dec 14, 2010 9:26 AM

    ScoobySi wrote:
    Yes I mean Time dimension, however in a DW you will have many Time dimensions, instead of creating a physical object for each you use a ROLE. If you edit a dimension in OWB you'll see that you can specify a ROLE on the first tab.
    Thanks for the great explaination... could you explain the process of roles a little more that will really save me some time... furthermore u stated
    + "instead of creating a physical object for each you use a ROLE" +
    The way i create dimensions is right clicking dimensions and selecting dimension.... for a standard dimension
    however incase of a time dimension i use a wizard... I am still a bit confused about "Physical objects" ... Id really really appreciated it if you can clarify this up...
    as discussed before one dimension would be Student and other would be subject
    and 3rd one would be TEST_DATE with role ?? and should that be a time_dimension or a standard dimension with a role defined ???

Maybe you are looking for

  • How can I use itunes store credit with Apple TV without the credit card code?

    I would like to allow guests in my home to use the credit in my iTunes account to purchase movies and TV shows on the Apple TV in my guest room. Unfortunately, it seems that in order to make a purchase they will need my credit card security code.  If

  • Loss of sound in all browsers showing youtube Videos?

    I don't really know where to start wit this one, I use both Firefox and Safari (& Camino sometimes) but for some reason none of them play sound for youtube videos. Obviously it isnt the speakers because they work fine with everything else- Any Ideas?

  • Firefox crashed when I try to get into my work site via citrix. Internet explore does not firefox 7.01

    I have firefox 7.01. and every time i try to log on to my work site via the web and client server, firefox crashes and leaves not log. Internet explore works without issue. How do I stop the system from crashing - i didnt have a problem in earlier ve

  • Help with Like Prepared statement

    Hi, Below is a part of the code in my test application which I am using for searching the phone book. I want to do a pattern search with like, but for some reason, my code is not fetching me the results. It just gives Zero results. But if i use "=" i

  • Convert Word document into HTML document

    Hello, I require an idea to accomplish the conversion of a .doc (word file) to .html (HTML file) in LabVIEW. I am working on a project in which i am having reports being generated after each test case execution. The data after the each test is meant