String not being a valid number

Hi,
I'm processing a set of strings in a loop, and I just want to continue if certain Strings are not valid numbers. I don't want an Exception thrown, I just want to skip over that String that is not a valid number. Any suggestions. Thank you.

Yeahhh, I agree with the last post now, scrap my
other reply.Well, it was just a little regex-test for fun* andI
wouldn't suggest the OP to use it in his
real-life code.
Reply #1 is (IMHO) the safest way to go aboutthis:
just (try) to parse it to whatever primitive you
want, and catch a possible exception.
* I made it a couple of days back: so I didn'tcome
up with it within the few minutes between george's
and my replies.Yeah I still think the first reply was best, much
easier to write atleast.
Besides that thing was a bit scary. It reminded me of
some AWK scripts I saw on a Unix forum and I just
thought wtf?Guy I work with is always bragging about his flatmates (I know!) mad SED skills. Impressive though I'm sure they are, I don't go drinking with these boys

Similar Messages

  • Null and empty string not being the same in object?

    Hello,
    I know that null and empty string are interpreted the same in oracle.
    However I discovered the strange behaviour concerning user defined objects:
    create or replace
    TYPE object AS OBJECT (
    value VARCHAR2(2000)
    declare
    xml xmltype;
    obj object;
    begin
    obj := object('abcd');
    xml := xmltype(obj);
    dbms_output.put_line(xml.getStringVal());
    obj.value := '';
    xml := xmltype(obj);
    dbms_output.put_line(xml.getStringVal());
    obj.value := null;
    xml := xmltype(obj);
    dbms_output.put_line(xml.getStringVal());
    end;
    When creating xml from object, all not-null fields are transformed into xml tag.
    I supposed that obj.value being either '' or null will lead to the same result.
    However this is output from Oracle 9i:
    <OBJECT_ID><VALUE>abcd</VALUE></OBJECT_ID>
    <OBJECT_ID><VALUE></VALUE></OBJECT_ID>
    <OBJECT_ID/>
    Oracle 10g behaves as expected:
    <OBJECT><VALUE>abcd</VALUE></OBJECT>
    <OBJECT/>
    <OBJECT/>
    However Oracle 9i behaviour leads me to the conclusion that oracle
    must somehow distinguish between empty string and null in user defined objects...
    Can someone clarify this behaviour?
    Thus is it possible to test if object's field is empty or null?

    However Oracle 9i behaviour leads me to the conclusion that oracle
    must somehow distinguish between empty string and null in user defined objects...
    Can someone clarify this behaviour?
    Thus is it possible to test if object's field is empty or null?A lot of "fixes" were done, relating to XML in 10g and the XML functionality of 9i was known to be buggy.
    I think you can safely assume that null and empty strings are treated the same by Oracle regardless. If you're using anything less than 10g, it's not supported any more anyway, so upgrade. Don't rely on any assumptions that may appear due to bugs.

  • String not being picked up in Function

    Im trying to add a string to a FUNCTION, but because the string contains a bracket and comma its not picking the string up.
    The STRING is : Christian (non-Catholic, non-specific)
    Below is the Script 
    SELECT c.DESCRIPTION
    , count(*)
    FROM [PLATOPROD].PSAG.dbo.PICS_Bedspace_current AS p
    LEFT OUTER JOIN AR_20120209_ChaplaincyPatientList AS c ON LEFT(p.[Reg No], 7) = c.IDENTIFIER collate database_default
    LEFT OUTER JOIN daily_builds.dbo.Daily_WardTrans_Static w on left(c.identifier,7) = left(w.unitno, 7)
    WHERE (c.ID IS NOT NULL)
    AND (c.description IN (select Param from [dbo].[fn_MVParamChar](@description, ',')) OR ('Protestant' IN (select Param from [dbo].[fn_MVParamChar](@description, ','))
    AND c.description IN (select Param from [dbo].[fn_MVParamChar]('Anglican,Baptist,Christian,Church of England,Church of God,''Christian (non-Catholic, non-specific)'',Methodist,Pentecostal,Presbyterian,Salvation Army,Free Church,Other Free Church', ',')) ) OR @description = 'All,')
    group by c.DESCRIPTION
    Below is the Function:
    ALTER FUNCTION [dbo].[fn_MVParamChar]
    (@RepParam varchar(8000), @Delim char(1)= ',')
    RETURNS @Values TABLE (Param varchar(8000))AS
    BEGIN
    DECLARE @chrind INT
    DECLARE @Piece varchar(8000)
    SELECT @chrind = 1
    WHILE @chrind > 0
    BEGIN
    SELECT @chrind = CHARINDEX(@Delim,@RepParam)
    IF @chrind > 0
    SELECT @Piece = LEFT(@RepParam,@chrind - 1)
    ELSE
    SELECT @Piece = @RepParam
    INSERT @Values(Param) VALUES(Cast(@Piece AS varchar(100)))
    SELECT @RepParam = RIGHT(@RepParam,LEN(@RepParam) - @chrind)
    IF LEN(@RepParam) = 0 BREAK
    END
    RETURN
    END

    Try the below query,
    SELECT c.DESCRIPTION
    , count(*)
    FROM [PLATOPROD].PSAG.dbo.PICS_Bedspace_current AS p
     LEFT OUTER JOIN AR_20120209_ChaplaincyPatientList AS c
      ON LEFT(p.[Reg No], 7) = c.IDENTIFIER collate database_default
     LEFT OUTER JOIN daily_builds.dbo.Daily_WardTrans_Static w
      on left(c.identifier,7) = left(w.unitno, 7)
    WHERE (c.ID IS NOT NULL)
           AND (c.description IN (select Param from [dbo].[fn_MVParamChar](@description, ',')) OR
             ('Protestant' IN (select Param from [dbo].[fn_MVParamChar](@description, ','))
      AND c.description IN (select Param from
       [dbo].[fn_MVParamChar]('Anglican,Baptist,Christian,Church of England,Church of God,Methodist,Pentecostal,Presbyterian,Salvation Army,Free Church,Other Free Church', ',')
       OR c.description IN ('Christian (non-Catholic, non-specific)') ) ) OR @description = 'All,')
    group by c.DESCRIPTION
    Regards, RSingh
    Msg 156, Level 15, State 1, Line 12
    Incorrect syntax near the keyword 'OR'.

  • My serial number is not being validated

    The serial number is C02G50EDDRJL.  It is printed on the back of the ocmputer and is not being accepted as validated to get on support chat.

    While Apple runs and maintains these forums, they are user to user, so you are very unlikely to get a response from an Apple employee here.
    Try contacting Apple Support.

  • Creative Suite 6 Design and Web Premium will not Reinstall: Says Serial Number is not "Valid"

    Chat support has been no help.  I uninstalled Creative Suite 6 because I was having issues with some of the software and hoped that a reinstall would solve the problem.  Now the software will not reinstall.  It takes me to the validation screen where it asks for the serial number and says "We are unable to validate this serial number for CS6 Design and Web Premium.  Please contact customer service," when i type the serial number in.  I have now gone through THREE chat sessions with "customer support" in which they have sent me a link to download the same program, and it would not reload because of the serial number, and then have walked me TWICE through a multitude of tasks that have not solved the problem.  They keep asking me the same questions again and again, ignore my own questions to them, and cannot give me any information that actually helps.  The phone system will not support Creative Suite.  I NEED this software to reload as I've already missed one publishing deadline and will miss another if I cannot use this software, which, at the moment, seems to be a $350 coaster.
    This is the same disc I used to install the software originally.  I installed it on my old laptop and used it there without incident until my new laptop came (a period of about two months).  I then Uninstalled the software from the old lap top and installed it on the new one, again, without incident.  When I found that the icons for switching between tools in Photoshop and Illustrator were so small I could not see them, and they seemingly could not be adjusted within the program, I uninstalled the software, and at this point is when the software would not reinstall on the same computer it was on in the first place.  My software is official, on a physical disc, and registered to my account with Adobe.  What do I do?  I just opened this press five months ago, and I cannot justify a Creative Cloud membership with the amount of work I'm actually putting out at the moment, and especially not with the terrible customer service I have been receiving so far.
    Please help.

    If you never deactivated, and neither did they, then that is likely to be a reason for not being able to activate again.  Contact them thru chat and ask them to reset your activations.
    Chat support - For the link below click the Still Need Help? option in the blue area at the bottom and choose the chat option...
    Serial number and activation chat support (non-CC)
    http://helpx.adobe.com/x-productkb/global/service1.html ( http://adobe.ly/1aYjbSC )

  • I need help with my serial number.  I downloaded soundbooth cs3 to restore my downloaded puchase, but my serial number is not being accepted.  I have 16 more days to resolve this.

    I need help with my serial number.  I downloaded soundbooth cs3 to restore my downloaded purchase, but my serial number is not being accepted.  I have 16 more days to resolve this.  I don't need tech support, I just need the software I purchased to work for me.  That's not to much to ask, is it?  Can anyone from adobe help me please?
    Chris

    Error "The serial number is not valid for this product" | Creative Suite

  • How can I activate an old version of Photoshop that I've loaded on my new tablet? The web activation doesn't work, and when I call the number, it says it's not being used anymore. Meanwhile, I'm down to 13 days till it stops working due to not being activ

    How can I activate an old version of Photoshop that I've loaded on my new tablet? The web activation doesn't work, and when I call the number, it says it's not being used anymore. Meanwhile, I'm down to 13 days till it stops working due to not being activated. HELP?  I really need to continue using this product for my home business.It works fine not activated but the threat is that it will stop working in 13 more days if I don't get it activated, and none of the activation methods they list seem to work.

    The new serial number is to the right of your chosen download.

  • Blue Screen with Text re IPOD size not being valid

    Now everytime I reboot, I get a blue screen full of text about the IPOD size not being valid, and I have to hit the reset button to get out of the loop.
    THEN, when I try to just wipe everything off the IPOD and start over/Restore, I get a message that says IPOD manager internal error.

    With the internal memory error message stopping Update, I went online to see if I could manually download the latest update...or any update. Even a previous version.
    But to do that I have to go back to Itunes 7...The only reason I don't like version 7 is that my Ipod contents disappear from the Itunes source window when the Ipod is not connected to the computer.
    Anyone know of a more reliable mp3 player ?
    Thanks for letting me ramble.
    Chip

  • Not being able to remove the voice mailbox number ...

    Hello
    I would like to ask you guys here at Nokia why you can't remove the voice mail box phone number after setting it the first time. Why is it so?
    To reproduce this "bug" go Menu -> Messaging -> Voice call messages -> Voice mailbox no.
    Set the voice mailbox number.
    Then, try to restore the settings to what it was originally.
    It won't work.
    I have tried this on several newer Nokia phones.
    Why is it so? Could "OK" maybe move to the left soft key? No. Of course not.
    Did you know everyone doesn't have voicemail?
    Therefore some users use the 1 key as any other quick dial key.
    I suppose that in any good user interface you should be able to restore a setting to it's original setting. Not being able to do so without any warning of some kind is simply ridiculous.
    If there is some other limitation that prevents you from doing this, please let me know.

    Why is nobody answering this?
    I would be very happy to discuss this.

  • HT2534 in my iphone5 'none' option for credit card is not being appeared. May be because of software upgrade or wot it is really not good as i don't want to share my credit card number.

    the 'none' option under payment methods is not being appeared in my iphone 5 as i don't want to share my credit card info. and my id stuck over that point as i am not abble to skip this step and it is a must option to select a credit card type and give a real credit card details. This is really not good.

    You have to enter your credit card number and some amount would be debited from your account(60 rs in india)
    After registration, You can Go to
    1 Settings
    2.Itunes&App Store
    3.Click on your apple id .
    4.Select View Apple ID
    5.Slecet Payment Info
    And You can find NONE here.
    Please select NONE to delete your credit card numbe r from the list
    But While registering you cant find NONE, you have to enter the cc number.
    Thank You
    Tejas

  • New CS6 on disk for Mac will not take my valid serial number; do I need to register the product before it will accept serial number and load on my Mac Book Pro?

    New CS6 on disk for Mac will not take my valid serial number; do I need to register the product before it will accept serial number and load on my Mac Book Pro?

    Hi Erwin,
    Please go through the below forum link and check.
    https://forums.adobe.com/thread/1079210
    Regards,
    Anand

  • Trying to install LR4 on a second computer but my serial number is not being accepted.

    Trying to install LR4 on a second computer but my serial number is not being accepted. What to do?

    there's nothing online about which i know.  but you may be able to get that info from adobe support, http://helpx.adobe.com/x-productkb/global/service1.html

  • 6th gen ipod nano serial number not being recognised by support

    I have just tried to register my 6th gen ipod nano on Apple's website and I get a message that says the number is not recognised, recheck and try again.  At first used number from nano box, then tried again after connecting nano to computer (same number appears of course) but still not being recognised.  The fact that the serial number is not being recognised is not helpful when you need help from support as they also require this information before they will contact you.  Why is my nano's serial number not being recognised?  More to the point, how do I get apple to recognise it?

    Are you sure aren't mistaking I's for 1's or O's of 0s?
    If you head to Settings - General -> About, does it list the same serial # there?
    B-rock

  • Check Number not being generated

    We do not have SAP Check printing functionality activated right now. So the checks will be handwritten. When i created the Payment Method for check, I assigned RFFOEDI1 in the payment medium program. I also created the check lot for that House bank and Company code in FCHI. I created a variant for RFFOEDI1 although i dont really need anything printed. Now when I am executing payment run, the payments are being posted fine. The check number is not being populated. I checked the Register (FCHN) and there are no entries. The Vendor has CHeck payment method in the master record and the payment method is also assigned as "Checks" in the Invoice.
    Not sure what is wrong. Help is highly appreciated.

    Hi,
    In case you use the check printing program from SAP, it will generate the check information and will assign to the documents automatically. However it is upto you whether you need to print the checks or not? But the check numbers have been generated by SAP. You can manually create the check for the payment documents matching those check numbers.
    The only thing is that the manual control should be there so that the check is manually created with same number as system generated in payment run. (Otherwise, do not generate check in F110, rather create check manually and assign to payment document in FCH5.)
    Regards,
    Gaurav

  • Since upgrading to iOS7 some text messages are not being sent, iMessage on my Ipad and MacBook doesn't have my phone number registered and my reminder colour on my Iphone keeps changing ... among other things

    Since upgrading to iOS7 some text messages are not being sent on my iPhone 5, iMessage on my Ipads and MacBook doesn't have my phone number registered and my reminder colour on my Iphone keeps changing ... among other things. Any suggestions to fix these faults?

    Make sure People Sending you via iMessage are sending their messages on your PHONE number not on your EMAIL addresses . My sister had the same problem, thats how i managed to solve it!

Maybe you are looking for

  • 10.4.10 - what a mess!

    1 ) dock not appearing at all - relaunch finder solves 2 ) firefox 2.0.0.4 crashes constantly - trying to reinstall 3 ) dock icons appearing as white blocks - no solution 4 ) photoshop registered an error loading files - delete preferences solves 5 )

  • FND_FLEX_SERVER validation error during Requisition Creation

    Has anyone encountered this inconsistent issue FND_FLEX_SERVER validation error (something related to account generator) at the time of creating requisition in iProcurement? I'm getting nowhere with my SR. Oracle wants me to provide a log of the erro

  • How to total a cost column

    How do you add/total an expense column in Numbers?

  • IPod touch 5G in stores?

    Does anyone know when the new iPod touch 5G's are officially going to be in stores?  Such as Wal mart or Electronic Express...?

  • Schedule line category defalut value in Inquiry

    Hi All I need to poulate default value ' Z2 'for schdule line category in Inquiry for specific document types . I am able to populate default value in inqurily . i am using MV45AFZZ.  But as per requirement if user manually changed the schedule line