Sunday, April 15, 2012

Implement ISNUMERIC function in SQL

a)
CREATE OR REPLACE FUNCTION isNumeric1 (p_num VARCHAR2)
 RETURN VARCHAR2
IS
 result VARCHAR2 (50);
BEGIN
 SELECT LENGTH (TRANSLATE (TRIM (p_num), ' +-.0123456789', ' ')) INTO result FROM DUAL;
 RETURN result;
END;
/

      It will return null if numeric, return count if non numeric characters otherwise.

b)
CREATE OR REPLACE FUNCTION isNumeric2 (p_num VARCHAR2)
 RETURN NUMBER
IS
 result NUMBER;
BEGIN
 SELECT INSTR (TRANSLATE (P_NUM, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'), 'X') INTO result FROM DUAL;

 RETURN result;
END;
/


    It returns 0 if it is a number, 1 if it is non-numeric.

3 comments:

  1. These hot heels are the latest in a series of fashion copycat skirmishes, including knockoff Michael Kors and Victoria Beckham dresses, Taylor Tomasi Hill's alleged Marc Jacobs ripoff and of course, that other famous copycat shoe case: Ivanka new balance Trump's supposed lifting of Derek Lam sandal designs.Despite an ongoing lawsuit, Christian Louboutin is having a great year. New mom Jessica Simpson has given mbt shoes clearance him shout outs, he's creating a real life Cinderella glass shoe and most recently, London's Design Museum has dedicated a whole exhibit to his mbt craftsmanship.
    After a look at 26 New Balance Releases for January 2015, the brand is back to showcase a number of new collections to louboutin shoes kick off the year strong. From the New Balance 696 “Tomboy Pack” strictly for the ladies that features a premium suede and some Camouflage mbt shoes for women donning classics, we can’t wait to see what else is in store for the brand. NB looks for eclectic inspirations nearly everywhere – even shoes with red soles guitars are referenced atop a few models. Which pair is your favorite? Be sure to check out more of the latest New Balance releases mbt shoes discontinued for January 2015 after the break and get updated on the latest release dates via our Sneaker Release Dates page.
    Just previewed yesterday, now www.overstock.com Social Status sails in with an official look at their upcoming collab with New Balance for the “Winter in the Hamptons” 1600. The cold new balance 998 season yachting-inspired sneaker features the classic runner in a mbt shoes premium blend of pig suede, nubuck and Cone denim. The leather and nubuck panels represent the interiors of luxurious yachts, while the dark denim is inspired by a boater’s material of choice when it gets too chilly for their lightweight summer khakis. Meanwhile, splashes of mbt mens shoes teal represent the ocean. Each pair will also come with custom social Status and New Balance branded hang tabs. The Social Status x New red bottom shoes Balance CM1600 “Winter in the Hamptons” drops December 13 in all six Social Status locations and on for $164.95.
    But do luxury department new balance shoes for women stores really care about attracting middle class shoppers? Certainly not if it means losing prestige with the uber-rich. Luxury spending is fueling growth in new balance shoes the fashion industry, as profits at upscale stores like Saks Fifth Avenue, Neiman Marcus and Nordstrom show. And unlike heel heights,

    ReplyDelete