Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Isnumeric question

RE: Isnumeric question

From: Mladen Gogala <mladen_at_wangtrading.com>
Date: Tue, 23 Sep 2003 14:24:40 -0800
Message-ID: <F001.005D0DB4.20030923142440@fatcity.com>


Perl regular expressions are very powerful and combined with the rest of perl, you get a unique tool for rapid programming. I'm learning perl/tk these days and I must say, it's extremely efficient and quick way to do stuff. Perl is interpreted, you get a good development environment which warns you about the syntax for free (no, not the stuff from Jared's book, I'm talking about the Eclipse, which I find extremely practical), perl is portable, you can run perl even without a database, and you can do things quickly. The only problem with perl is that the language itself is huge. Add modules like DBI, Tk, File::Basename, perlpod and alike and you have a lot to learn. I plan on learning Python before Thanksgiving and II'll give you a comparison if you are still interested at that time.  

Regular expressions are nice and if you want a pure oracle solution, then, PL/SQL is the way to go. There are things that are simply not duable with PL/SQL, like the communication with the operating system. You cannot
say anything like this in PL/SQL

       open(LP,"|lp -d HP_4200")||die "Cannot open LP: $!\n"; The reason why I started using perl are formats. Perl has a decent report writer and you can get much cleaner and prettier reports with perl then with sqlplus. You probably remember rpt/rpf. I really miss a procedural report writing tool like that. Perl simply filled the void.    

--
Mladen Gogala
Oracle DBA 


-----Original Message-----
Mercadante, Thomas F
Sent: Tuesday, September 23, 2003 4:45 PM
To: Multiple recipients of list ORACLE-L


Mladen,
 
While I respect you and your ability with using Perl, if this capability
with regular expressions now exists directly within PL/SQL, then why would I
want to use Perl to do this?  
 
Oracle Magazine had a pretty good article describing the newly-renamed
Oracle Expressions (don't you *love it* when Oracle renames something and
then pushes it in the press like it's brand-freekin-new - like Grid
Computing).
 
Looks pretty powerful, though I don't have a need for it yet.
 
Tom Mercadante 
Oracle Certified Professional 

-----Original Message-----
Sent: Tuesday, September 23, 2003 4:25 PM
To: Multiple recipients of list ORACLE-L


Let's see:
 
Oracle Regular Expressions Pocket Reference is part tutorial and part
quick-reference. It's suitable for those who have never used regular
expressions before, as well as those who have experience with Perl and other
languages supporting regular expressions. The book describes Oracle Database
10G's support for regular expressions, including globalization support and
differences between Perl's syntax and the POSIX syntax supported by Oracle
10G. It also provides a comprehensive reference, including examples, to all
supported regular expression operators, functions, and error messages. 
 
This book like it's written for the same version as the article I pulled
from OTN. I think I can top that and add the full
strength of the regular expressions to 8.1.7. Visit the following URL:
http://www.smashing.org/extproc_perl and you'll get the 
idea how it's done.
 
 
 
--
Mladen Gogala
Oracle DBA 


-----Original Message-----
Jared.Still_at_radisys.com
Sent: Tuesday, September 23, 2003 1:40 PM
To: Multiple recipients of list ORACLE-L



Or, how about:  http://www.oreilly.com/catalog/oracleregexpr/ 




	Mladen Gogala <mgogala_at_adelphia.net> 
Sent by: ml-errors_at_fatcity.com 


 09/22/2003 06:44 PM 
 Please respond to ORACLE-L 


        
        To:        Multiple recipients of list ORACLE-L
<ORACLE-L_at_fatcity.com> 
        cc:         
        Subject:        Re: Isnumeric question	



Here is a good impossible solution which can be used
to make this list drool:

http://technet.oracle.com/oramag/webcolumns/2003/techarticles/rischert_regex
p_pt1.html


On 2003.09.22 21:24, Jacques Kilchoer wrote:

> >-----Original Message-----
> >From: ml-errors_at_fatcity.com [mailto:ml-errors_at_fatcity.com]On Behalf Of
> Teresita Castro
> >
> >I want to made something like this ina query
> >
> >select decode( isnumeric(line_comment), to_number(line_comment),0)
> >
> >how can I do this in Oracle?
>
> First you need to define what "isnumeric" means to you.
> Does it mean
> a) this string only contains ASCII characters 0 through 9
> b) this string only contains ASCII characters 0 through 9 with maybe one
> decimal point (as determined by my NLS settings)'
> c) this string only contains ASCII characters 0 through 9 with maybe one
> decimal point and group separators (as determined by my NLS settings)
> d) 'this string contains a valid ORACLE number constant' e.g. -2.3e+10 is
a
> valid number?
> e) something else (minus signs, etc.)
>
> If the answer is d), then (from an old idea by Jared Still) create your
own
> function
> create function is_number (str in varchar2)
> return number
> is
> x number ;
> begin
> x := to_number (str) ;
> return 1 ;
> exception
> when value_error
> then
> return 0 ;
> when others
> then
> raise ;
> end ;
> /
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.net
> --
> Author: Jacques Kilchoer
> INET: Jacques.Kilchoer_at_quest.com
>
> Fat City Network Services -- 858-538-5051 http://www.fatcity.com
> San Diego, California -- Mailing list and web hosting services
> ---------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
> -- Mladen Gogala Oracle DBA -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Mladen Gogala INET: mgogala_at_adelphia.net Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Note: This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. Wang Trading LLC and any of its subsidiaries each reserve the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of any such entity. Note: This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. Wang Trading LLC and any of its subsidiaries each reserve the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of any such entity. -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Mladen Gogala INET: mladen_at_wangtrading.com Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Received on Tue Sep 23 2003 - 17:24:40 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US