Using or operator with char in a switch

Can someone please provide the syntax for an or statement that would cover this? Thanks.
substring = inputString.charAt(i);
            switch(substring){
                case 'a':
                    vowelsL++;
                    vowelsT++;
                    break;
                case 'e':
                    vowelsL++;
                    vowelsT++;
                    break;
                case 'i':
                    vowelsL++;
                    vowelsT++;
                    break;
                case 'o':
                    vowelsL++;
                    vowelsT++;
                    break;
                case 'u':
                    vowelsL++;
                    vowelsT++;
                    break;I tried this but it didnt work
case 'a'|'e'|'i'|'o'|'u':Can the or operator work this way with chars?
Thanks

warnerja wrote:
uj_ wrote:
warnerja wrote:
I don't recall that syntax.How absolutely astonishing!So you're saying you think you can do this in a switch statement block?
case 'a', 'e', 'i', 'o', 'u' : // code here for all 5 cases
How absolutely astonishing!I find your desparate need to cherish this moment astonishing. You even dug out and reposted an erased post in order to triumph. Well done sheriff Warnerja. Now go back to Schmuckville were you belong.
Well, to be frank I sometimes get simple syntax wrong. It's because I've used and use many different languages so I sometimes mix them up. That's another thing I find astonishing. You cannot recall a single language with the syntax I suggested? Why don't you pull your head out of your azz on occasion. It may broaden your outlook.

Similar Messages

  • Error while using between operator with sql stmts in obiee 11g analytics

    Hi All,
    when I try to use between operator with two select queries in OBIEE 11g analytics, I'm getting the below error:
    Error Codes: YQCO4T56:OPR4ONWY:U9IM8TAC:OI2DL65P
    Location: saw.views.evc.activate, saw.httpserver.processrequest, saw.rpc.server.responder, saw.rpc.server, saw.rpc.server.handleConnection, saw.rpc.server.dispatch, saw.threadpool.socketrpcserver, saw.threads
    Odbc driver returned an error (SQLExecDirectW).
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 27002] Near <select>: Syntax error [nQSError: 26012] . (HY000)
    can anyone help me out in resolving this issue.

    Hi All,
    Thank u all for ur replies, but I dint the exact solution for what I'm searching for.
    If I use the condition as
    "WHERE "Workforce Budget"."Used Budget Amount" BETWEEN MAX("Workforce Budget"."Total Eligible Salaries") AND MAX("Workforce Budget"."Published Worksheet Budget Amount"",
    all the data will be grouped with the two columns which I'm considering in the condition.
    my actual requirement with this query is to get the required date from a table to generate the report either as daily or weekly or monthly report. If I use repository variables, variables are not getting refreshed until I regenerate the server(which I should not do in my project). Hence I have created a table to hold weekly start and end dates and monthly start and end dates to pass the value to the actual report using between operator.
    please could anyone help me on this, my release date is fast approaching.

  • Using OR operator with string

    How we can use OR operator with string in java??

    Gaurav1 wrote:
    its logical OR operator;how can we use it with matcher classLike its been said already. The "logical OR" is used the same everywhere.
    Why don't you post the code you're having problems with. (Only the relevant areas, please. And use code tags.)

  • I have The last version of the MAC GT 4 desktop, don't intend to buy a new on just so I can upgrade to Firefox 4 so what alternative do I have - keep using Firefox3.6 with no support or switch to

    I have The last version of the MAC GT 4 desktop, don't intend to buy a new one just so I can upgrade to Firefox 4 - so what alternative do I have - keep using Firefox3.6 with no support or switch to another Browser?

    Firefox 4 requires at least OS X 10.5 and an Intel Mac. There is a third party version of Firefox 4 that runs on OS X 10.4/10.5 and PPC Macs, for details see http://www.floodgap.com/software/tenfourfox
    If you prefer, you can get the latest version of Firefox 3.6 from http://www.mozilla.com/en-US/firefox/all-older.html
    Firefox 3.6 is still being supported.

  • Using in operator with bindveriable

    Dear All,
    i facing proplem when i try to make SQL query using "in" operator but i send value as bind virable
    example
    Select emp.emp_id
    from emp
    where emp.emp_id in (:pEmpId)
    but when i execute it and enter value for the bind i didn't get the result .
    any idea how to solve this problem
    Best Regards

    Something like this will work (10g onwards)
    SQL> ed
    Wrote file afiedt.buf
      1  with req as (select '&required_empnos' as empno from dual)
      2  --
      3  select *
      4  from emp
      5  where empno in
      6    (select regexp_substr(empno, '[^,]+', 1, rownum)
      7     from req
      8*    connect by rownum <= length(regexp_replace(empno, '[^,]'))+1)
    SQL> /
    Enter value for required_empnos: 7839,7499,7934
    old   1: with req as (select '&required_empnos' as empno from dual)
    new   1: with req as (select '7839,7499,7934' as empno from dual)
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7839 KING       PRESIDENT            17-NOV-81       5000                    10
          7934 MILLER     CLERK           7782 23-JAN-82       1300                    10
          7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30
    SQL>

  • Why not use "new" operator  with strings

    why we not use new when declaring a String .because in java String are treated as objects. we use new operator for creating an object in java .
    and same problem wiht array when we declare array as well as initialize .here we are alse not using new for array
    why

    Strings aren't just treated as objects, Strings are Objects.
    As for why not using new for Strings, you can, if you want.:
    String str = "this is a string";
    and
    String str = new String("this is a string");
    do the same thing (nitty-gritty low level details about literals aside). Use whatever you like, but isn't it simpler not to type new String(...) since you still need to type the actual string?
    As for arrays, you can use new:
    int[] ints = new int[10];
    or
    int[] ints = { 0, 1, 2, 3, ..., 9 };
    But the difference here is you are creating an empty array in the first one, the second creates and fills the array with the specified values. But which to you often depends on what you are doing.

  • Using Time Capsule with a router or switch

    I have a Time Capsule and I need to extend my network. I am wondering what the best way to do it is. Here's the situation. I am currently using the Time Capsule for both wired ethernet and wireless connections. But I need to expand the number of wired connections. From reading posts I gather that I can indeed connect an ethernet switch downstream of the Time Capsule to increase the number of available nodes in the network. My question is would there be any strong advantage to putting a router between the DSL Modem and the Time Capsule? Obviously, that would mean reconfiguring the Time Capsule to bridge mode which is not that hard.
    The main advantage I can think of of putting a router upstream of the Time Capsule is the security of a build in firewall in the router. But using a Switch down stream is physically, with my set up, easier and cheaper as I have a spare switch. Is there a reason to choose one course over the other?
    Thanks,
    J. Latta

    Operationally it won't make any difference. The operation of NAT on the Time Capsule offers an effective firewall.

  • How to use LIKE operator with PreparedStatement

    Hi, I need to execute a query with the LIKE operator, but using a PreparedStatement. Can I do this, and if so what must my SQL look like with the wildcard characters '%' or '_'?
    normal PS example: conn.prepareStatement("select * from mytable where name like ?");
    If I try: conn.prepareStatement("select * from mytable where name like ?%");
    I get: ORA-00911: invalid character
    If I try: conn.prepareStatement("select * from mytable where name like '?%'");
    I get: ORA-01006: bind variable does not exist
    I must use a PreparedStatement, as my variable may contain illegal characters (like '), and using PreparedStatement.setString(1, var) will automatically escape it for me.
    I could also use a normal Statement, but I need to escape my var ... is there a utility that will safely escape a String for an Oracle VARCHAR2??
    Thanks in advance,
    Stu Miller

    Hmm, it seems you are right...
    when my variable contains a '%' symbol, the PreparedStatement will NOT escape it, and thus it is treated like a wildcard. Therefore, I can just do
    pstmt.setString(1, var+"%");
    But, that may return more results than I'm asking for, as when 'var' contains a '%' symbol it is taken as a wildcard too.
    I need each character in my variable to be taken literally, and only add a wildcard at the end. Basically, I need a STARTSWITH operator ;-)
    It seems to me that escaping the sensitive characters in a String (which will differ depending on which operator is used), should be possible. I could write this, but I was hoping Oracle had already done it for me in some utility class.

  • How to use filter operator with ROWNUM

    I would like to add filter operator in my mapping with ROWNUM to reduce the ETL loading time during testing to ensure mapping is working, but I don't know how, please help provide me some guideline. Thank you.

    what is your owb version?
    Starting with Oracle Warehouse Builder 10.2.0.3, you can use the pseudocolumns ROWID and ROWNUM in mappings. The ROWNUM pseudocolumn returns a number indicating the order in which a row was selected from a table. The ROWID pseudocolumn returns the rowid (binary address) of a row in a database table.
    You can use the ROWID and ROWNUM pseudocolumns in Table, View, and Materialized View operators in a mapping. These operators contain an additional column called COLUMN USAGE that is used to identify attributes used as ROWID or ROWNUM. For normal attributes, this column defaults to TABLE USAGE. To use an attribute for ROWID or ROWNUM values, set the COLUMN USAGE to ROWID or ROWNUM respectively.
    You can map a ROWID column to any attribute of data type ROWID, UROWID, or VARCHAR2. You can map ROWNUM column to an attribute of data type NUMBER or to any other data type that allows implicit conversion from NUMBER.
    Note that ROWID and ROWNUM pseudocolumns are not displayed in the Data Object Editor since they are not real columns.
    Edited by: Darthvader-647181 on Oct 29, 2008 9:18 AM

  • Use wireless router with existing network and switch?

    I have an existing network using a T1 into a switch; all the computers and the server are connected to the switch. Some distance away, via ethernet cable to the switch, I would like to connect a wireless router, one computer wired to that router, and other computers connect via wireless. Our server provides DHCP. Is this possible? How best to do it? Which Linksys router would be best for the purpose? Thanks for the help!

    The "correct" device to use would be a wireless access point like the Linksys WAPs and not a WRT router. WRT routers are supposed to connect to the internet on its own.
    You can set up a WRT router as simple access point. see here for the setup.
    The best router is the one which best suits your needs. All wireless routers and access point provide wireless access. It depends on what you want (802.11n, 11b, 11g, range, speed, etc.). The newer routers are better from the specifications but usually also have more firmware bugs. But that's pretty much all one can say based on your generic requirements.

  • How to use LIKE Operator with my query requriment

    HI all,
    I have a requirement as follows
    EMPID ENAME JOB SAL
    10 RAJ KAMAL MANAGER 25000
    20 KAMAL RAJ NAYAK CLERK 4000
    30 NARENDAR GUPTA ANALYST 20000
    40 ASHUTOSH GUPTA DEVELOPER 10000
    50 ASHUTOSH NAYAR PROGRAMMER 15000
    i am searching enames such that i need to get the whole name even if i search with just a single LETTER/WORD immaterial of the order they exist in the name for which i need to get the whole name.(INFACT WORD comparision)
    ex:
    1) select * from emp where ename like '%ka%'
    i am getting:
    10 RAJ KAMAL MANAGER 25000
    20 KAMAL RAJ NAYAK CLERK 4000
    This is not what i need i need just word camparision not letters comparision let me tell you...
    select * from emp where ename like '%amal%'
    Even for this query ill get the same output.. this is not my option to go..
    I need just word comparision with starting letter and immaterial of the word position in the name
    If it is possible to do with query please let me know..
    Thanking you
    Narendar Vishwanatham

    Full example:
    SQL> ed
    Wrote file afiedt.buf
      1  with e as (select 10 as empid, 'RAJ KAMAL' as ename, 'MANAGER' as job, 25000 as sal from dual union all
      2             select 20, 'KAMAL RAJ NAYAK', 'CLERK', 4000 from dual union all
      3             select 30, 'NARENDAR GUPTA', 'ANALYST', 20000 from dual union all
      4             select 40, 'ASHUTOSH GUPTA', 'DEVELOPER', 10000 from dual union all
      5             select 50, 'ASHUTOSH NAYAR', 'PROGRAMMER', 15000 from dual)
      6  -- END OF TEST DATA
      7  select *
      8  from e
      9* where regexp_like(ename,'(^| )KA( |$)')
    SQL> /
    no rows selected
    SQL> ed
    Wrote file afiedt.buf
      1  with e as (select 10 as empid, 'RAJ KAMAL' as ename, 'MANAGER' as job, 25000 as sal from dual union all
      2             select 20, 'KAMAL RAJ NAYAK', 'CLERK', 4000 from dual union all
      3             select 30, 'NARENDAR GUPTA', 'ANALYST', 20000 from dual union all
      4             select 40, 'ASHUTOSH GUPTA', 'DEVELOPER', 10000 from dual union all
      5             select 50, 'ASHUTOSH NAYAR', 'PROGRAMMER', 15000 from dual)
      6  -- END OF TEST DATA
      7  select *
      8  from e
      9* where regexp_like(ename,'(^| )KAMAL( |$)')
    SQL> /
         EMPID ENAME           JOB               SAL
            10 RAJ KAMAL       MANAGER         25000
            20 KAMAL RAJ NAYAK CLERK            4000
    SQL>

  • Using like operator with attributes in select command

    Hi,
    I have a table with the attributes as DID, PNO,AGE, DEPARTMENT, DATEOFADM, CHARGES, ADDRESS, DOD
    I want to display the records with the months in DOD and DATEOFADM same. How can I do so? I also want to do the same with the dates in the 2 attributes.
    Thanks
    Edited by: 1004111 on May 23, 2013 1:51 AM

    Hi,
    Please read SQL and PL/SQL FAQ
    When you put some <b>code or output</b> please enclose it between two lines starting with {noformat}<b></b>{noformat}
    i.e.:
    {noformat}{noformat}
    SELECT ...
    {noformat}{noformat}
    You should post create table and insert statement for your requirement.
    You can check if 2 dates have the same month in either way:-- this is comparing year and month
    SELECT *
    FROM yourtable
    WHERE TRUNC(dod,'MM')=TRUNC(dateofadm,'MM');
    -- or in case you want to compare only months no matter the year
    SELECT *
    FROM yourtable
    WHERE EXTRACT(MONTH FROM dod) = EXTRACT(MONTH FROM dateofadm);
    Regards.
    Al                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Crash of Oracle XE when check constraint uses in-operator with desc. values

    ORA-03113 and other errors in conjunction with lost of connection occur in Oracle XE under the following conditions:
    /* Crash (values of check constraint in descending order) */
    DROP TABLE CRASHTEST CASCADE CONSTRAINTS;
    CREATE TABLE CRASHTEST
    CRASHTEST_ID NUMBER(9),
    CRASHTEST_OK NUMBER(1) DEFAULT 0
    ALTER TABLE CRASHTEST ADD (CONSTRAINT CRASHTEST_CK CHECK (CRASHTEST_OK IN (0,-1)));
    INSERT INTO CRASHTEST (CRASHTEST_ID, CRASHTEST_OK) VALUES (1, 0);
    INSERT INTO CRASHTEST (CRASHTEST_ID, CRASHTEST_OK) VALUES (2, -1);
    COMMIT;
    SELECT * FROM CRASHTEST WHERE CRASHTEST_OK = 0;
    If all values of the in-clause within the check constraint are entered in ascending order, no error occurs:
    /* No Crash (values of check constraint in ascending order) */
    DROP TABLE CRASHTEST CASCADE CONSTRAINTS;
    CREATE TABLE CRASHTEST
    CRASHTEST_ID NUMBER(9),
    CRASHTEST_OK NUMBER(1) DEFAULT 0
    ALTER TABLE CRASHTEST ADD (CONSTRAINT CRASHTEST_CK CHECK (CRASHTEST_OK IN (-1,0)));
    INSERT INTO CRASHTEST (CRASHTEST_ID, CRASHTEST_OK) VALUES (1, 0);
    INSERT INTO CRASHTEST (CRASHTEST_ID, CRASHTEST_OK) VALUES (2, -1);
    COMMIT;
    SELECT * FROM CRASHTEST WHERE CRASHTEST_OK = 0;
    Especially interesting is the fact, that the error is caused by a check constraint in conjunction with a select statement!
    Hopefully, there are no other hidden bombs stealing my time...
    Have a nice day,
    Sven

    It might be interesting to post that in the XE forum to notify Oracle developers and XE users.
    Oracle Database Express Edition (XE)
    C.

  • Use NSString initWithUTF8String with char * pointer Crash

    My program below crashed in weird:
    char p[256];
    NSString *ns, *ns1;
    ns1 = @"foo";
    strcpy( p, [ns1 UTF8String] );
    // crash below
    [ns initWithUTF8String:p];
    =============================================
    Anyway to convert NSString to C char string?

    CharlieCL wrote:
    BTW. I tried to add {code} around the code after the post, but I did not know how to modify the posted article. Is there any modify function in this forum?
    There is, but you can only do so within 15 minutes of posting.

  • Error Handling while using Batch Operation

    Hi Experts,
    I am trying to update document with multiple successful items using batch operation with single changeset and document is updating successfully.
    But when i am trying to update document with multiple unsuccessful items, I am getting error saying " HTTP/1.1 500 Internal Server Error" .
    If it is for a single unsuccessful item,i am able to get the error message as return parameter, but i am not able to get the error messages as return parameter  if it is for multiple(more than one item) unsuccessful items.
    Could you please let me know your thoughts on this.
    Thanks,
    Syam

    Yes: I can.
    Provided someone provides version information
    Provided someone identifies specific API's
    Provided someone defines what conversions they are referring to.
    After you've defined the problem go to metalink or tahiti and look up the answer yourself.

Maybe you are looking for

  • Change resolution on i photo

    Simple request....how do I change the resolution on a photo in I photo. All I want to do is make higher resolutions smaller so I can post it on the internet. Didn't realize this could be so frustrating.

  • Networking between macs problem

    I have a Macbook pro and an 2 iMacs running mavericks and windows 7 under parallels and also 2 PC's running windows 7 on my LAN.  They are all linked up with ethernet cables to a hub and a router.  Internet connection on all is good and solid and nev

  • Mac OSX 10.4 Installer Disc

    Hi, I have a 15 inch Macbook Pro, bought two years ago. After all that time its become kind of.. clogged, slowing down, more prone to crashing, so I wanted to reinstall OS X. It came with OS X 10.4 installer discs but they were lost a long while ago.

  • Is it possible to update from 10.6.8 to 10.8.X ?

    I have bought macbook pro that has 10.6.8 but when I try to buy mountain lion thourgh App store I got the information that it is not compatible with current comuter. Is it possible to try to e.g. 10.7.X?

  • Probleme avec photoshop element 9

    Bonjour j'ai un soucis avec Photoshop element 9, il ne veut plus s ouvrir. Il m ecrit un message: We're sorry, but the safari browser version you are currently using does not support the community tollbar. Je suis sur mac et je n'ai rien toucher au s