Re: Isnumeric question
Mladen Hm The company where my brother worked at last had hundreds of perl scripts implementing most of their printing application. It has all now been ported to java for similar reasons. Maybe you are better with python then?, its not as huge as perl, that's for sure cheers Pete -- Pete Finnigan email:[EMAIL PROTECTED] Web site: http://www.petefinnigan.com - Oracle security audit specialists Book:Oracle security step-by-step Guide - see http://store.sans.org for details. -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Pete Finnigan INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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).
RE: Isnumeric question
Crap. I guess I'll have to read another Perl book to continue writing Perl programs. And just when it was going so well... Rich Rich Jesse System/Database Administrator [EMAIL PROTECTED] Quad/Tech Inc, Sussex, WI USA > -Original Message- > From: Mladen Gogala [mailto:[EMAIL PROTECTED] > Sent: Thursday, September 25, 2003 1:20 PM > To: Multiple recipients of list ORACLE-L > Subject: RE: Isnumeric question > > > Because my new company is using python and I think I'll have > to learn it > sooner or later. > What is more, there seems to be growing confusion with > versions on Windows > operating > systems. ActiveState is lagging behind with DBI/DBD drivers > and it was a > problem to get > it all working. > What is more, Perl 6 is in the making, to be launched early > next year. Do > you remember > transition from the perl4 -> perl5 and from "oraperl" (perl 4.36) --> > DBI/DBD? If I have > to re-read all the books just to keep my knowledge, it will be a huge > investment. There are > many things that are not mentioned in "Learning Perl" and > without which perl > is practically > unusable. I'm talking about the references, objects, perlpod, > "anonymous > subroutines", "arrays > of references" and alike. For example \($a,$b,$c,$d) > =(\$a,\$b,\$c,\$d) > while [$a,$b,$c,$d] > is a reference to array. In order for perl to be useful, one must read > "Learning Perl" + at > least one other book about Perl & OO, and, of course, have "Perl > Programming" at the shelf, > whe he needs to find an appropriate built-in variable. Re-learning and > re-purchasing my 3rd > set of books is going to be quite expensive. Tim O'Reilly > will probably > surpass Jeff Bezos on > the Forbes list when that happens. BTW, are Tim O'Reilly and > Bill O'Reilly > related in any way, > shape or form? -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Jesse, Rich INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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).
RE: Isnumeric question
Because my new company is using python and I think I'll have to learn it sooner or later. What is more, there seems to be growing confusion with versions on Windows operating systems. ActiveState is lagging behind with DBI/DBD drivers and it was a problem to get it all working. What is more, Perl 6 is in the making, to be launched early next year. Do you remember transition from the perl4 -> perl5 and from "oraperl" (perl 4.36) --> DBI/DBD? If I have to re-read all the books just to keep my knowledge, it will be a huge investment. There are many things that are not mentioned in "Learning Perl" and without which perl is practically unusable. I'm talking about the references, objects, perlpod, "anonymous subroutines", "arrays of references" and alike. For example \($a,$b,$c,$d) =(\$a,\$b,\$c,\$d) while [$a,$b,$c,$d] is a reference to array. In order for perl to be useful, one must read "Learning Perl" + at least one other book about Perl & OO, and, of course, have "Perl Programming" at the shelf, whe he needs to find an appropriate built-in variable. Re-learning and re-purchasing my 3rd set of books is going to be quite expensive. Tim O'Reilly will probably surpass Jeff Bezos on the Forbes list when that happens. BTW, are Tim O'Reilly and Bill O'Reilly related in any way, shape or form? -- Mladen Gogala Oracle DBA > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On > Behalf Of Pete Finnigan > Sent: Thursday, September 25, 2003 1:45 PM > To: Multiple recipients of list ORACLE-L > Subject: Re: Isnumeric question > > > Mladen, > > Why python?, why not keep using perl? > > cheers > > pete > -- > Pete Finnigan > email:[EMAIL PROTECTED] > Web site: http://www.petefinnigan.com - Oracle security audit > specialists Book:Oracle security step-by-step Guide - see http://store.sans.org for details. -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Pete Finnigan INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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. -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Mladen Gogala INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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).
Re: Isnumeric question
Mladen, Why python?, why not keep using perl? cheers pete -- Pete Finnigan email:[EMAIL PROTECTED] Web site: http://www.petefinnigan.com - Oracle security audit specialists Book:Oracle security step-by-step Guide - see http://store.sans.org for details. -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Pete Finnigan INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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).
RE: Isnumeric question
Title: Message 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 GogalaOracle DBA -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mercadante, Thomas FSent: Tuesday, September 23, 2003 4:45 PMTo: Multiple recipients of list ORACLE-LSubject: RE: Isnumeric question 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-From: Mladen Gogala [mailto:[EMAIL PROTECTED]Sent: Tuesday, September 23, 2003 4:25 PMTo: Multiple recipients of list ORACLE-LSubject: RE: Isnumeric question 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 GogalaOracle DBA -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]Sent: Tuesday, September 23, 2003 1:40 PMTo: Multiple recipients of list ORACLE-LSubject: Re: Isnumeric questionOr, how about: http://www.oreilly.com/catalog/oracleregexpr/ Mladen Gogala <[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED] 09/22/2003 06:44 PM Please respond to ORACLE-L To: Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]> cc: Subject: Re: Isnumeric questionHere is a good impossible solution which can be usedto make this list drool:http://technet.oracle.com/oramag/webcolumns/2003/techarticles/rischert_regexp_pt1.htmlOn 2003.09.22 21:24, Jacques Kilchoer wrote:> >-Original Message-> >From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 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
RE: Isnumeric question
Regex is only part of the Perl story. If you must do many complex string manipulations, Oracle cannot compete with Perl. Jared "Mercadante, Thomas F" <[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED] 09/23/2003 01:44 PM Please respond to ORACLE-L To: Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]> cc: Subject: RE: Isnumeric question 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- From: Mladen Gogala [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 23, 2003 4:25 PM To: Multiple recipients of list ORACLE-L Subject: RE: Isnumeric question 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- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Tuesday, September 23, 2003 1:40 PM To: Multiple recipients of list ORACLE-L Subject: Re: Isnumeric question Or, how about: http://www.oreilly.com/catalog/oracleregexpr/ Mladen Gogala <[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED] 09/22/2003 06:44 PM Please respond to ORACLE-L To: Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]> 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_regexp_pt1.html On 2003.09.22 21:24, Jacques Kilchoer wrote: > >-Original Message- > >From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 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: [EMAIL PROTECTED] > > 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: [EMAIL PROTECTED] (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 (l
RE: Isnumeric question
Title: Message 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-From: Mladen Gogala [mailto:[EMAIL PROTECTED]Sent: Tuesday, September 23, 2003 4:25 PMTo: Multiple recipients of list ORACLE-LSubject: RE: Isnumeric question 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 GogalaOracle DBA -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]Sent: Tuesday, September 23, 2003 1:40 PMTo: Multiple recipients of list ORACLE-LSubject: Re: Isnumeric questionOr, how about: http://www.oreilly.com/catalog/oracleregexpr/ Mladen Gogala <[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED] 09/22/2003 06:44 PM Please respond to ORACLE-L To: Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]> cc: Subject: Re: Isnumeric questionHere is a good impossible solution which can be usedto make this list drool:http://technet.oracle.com/oramag/webcolumns/2003/techarticles/rischert_regexp_pt1.htmlOn 2003.09.22 21:24, Jacques Kilchoer wrote:> >-Original Message-> >From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 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: [EMAIL PROTECTED]> > 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: [EMAIL PROTECTED] (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 GogalaOra
RE: Isnumeric question
Title: Message 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 GogalaOracle DBA -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]Sent: Tuesday, September 23, 2003 1:40 PMTo: Multiple recipients of list ORACLE-LSubject: Re: Isnumeric questionOr, how about: http://www.oreilly.com/catalog/oracleregexpr/ Mladen Gogala <[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED] 09/22/2003 06:44 PM Please respond to ORACLE-L To: Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]> cc: Subject: Re: Isnumeric questionHere is a good impossible solution which can be usedto make this list drool:http://technet.oracle.com/oramag/webcolumns/2003/techarticles/rischert_regexp_pt1.htmlOn 2003.09.22 21:24, Jacques Kilchoer wrote:> >-Original Message-> >From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 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: [EMAIL PROTECTED]> > 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: [EMAIL PROTECTED] (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 GogalaOracle DBA-- Please see the official ORACLE-L FAQ: http://www.orafaq.net-- Author: Mladen Gogala INET: [EMAIL PROTECTED]Fat City Network Services -- 858-538-5051 http://www.fatcity.comSan Diego, California -- Mailing list and web hosting services-To REMOVE yourself from this mailing list, send an E-Mail messageto: [EMAIL PROTECTED] (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 mayalso 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 t
RE: Isnumeric question
Title: Message I have a hunch that I'll continue to use perl for a while. I don't know why, but I just feel that way. --Mladen GogalaOracle DBA -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]Sent: Tuesday, September 23, 2003 1:40 PMTo: Multiple recipients of list ORACLE-LSubject: Re: Isnumeric questionOr, how about: http://www.oreilly.com/catalog/oracleregexpr/ Mladen Gogala <[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED] 09/22/2003 06:44 PM Please respond to ORACLE-L To: Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]> cc: Subject: Re: Isnumeric questionHere is a good impossible solution which can be usedto make this list drool:http://technet.oracle.com/oramag/webcolumns/2003/techarticles/rischert_regexp_pt1.htmlOn 2003.09.22 21:24, Jacques Kilchoer wrote:> >-Original Message-> >From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 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: [EMAIL PROTECTED]> > 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: [EMAIL PROTECTED] (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 GogalaOracle DBA-- Please see the official ORACLE-L FAQ: http://www.orafaq.net-- Author: Mladen Gogala INET: [EMAIL PROTECTED]Fat City Network Services -- 858-538-5051 http://www.fatcity.comSan Diego, California -- Mailing list and web hosting services-To REMOVE yourself from this mailing list, send an E-Mail messageto: [EMAIL PROTECTED] (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 mayalso 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.
Re: Isnumeric question
Or, how about: http://www.oreilly.com/catalog/oracleregexpr/ Mladen Gogala <[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED] 09/22/2003 06:44 PM Please respond to ORACLE-L To: Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]> 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_regexp_pt1.html On 2003.09.22 21:24, Jacques Kilchoer wrote: > >-Original Message- > >From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 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: [EMAIL PROTECTED] > > 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: [EMAIL PROTECTED] (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: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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).
Re: Isnumeric question
create or replace function isnumeric(p_string in varchar2)
return char
is
n_value number;
e_not_a_number exception;
PRAGMA EXCEPTION_INIT(e_not_a_number, -6502);
begin
n_value := p_string;
return 'Y';
exception
when e_not_a_number then
return 'N';
end;
/
SQL> @isnumeric
Function created.
SQL> select isnumeric('1234'), isnumeric('123D') from dual;
ISNUMERIC('1234')
ISNUMERIC('123D')
Y
N
SQL>
--
Regards,
Stephane Faroult
Oriole Software
--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author: Stephane Faroult
INET: [EMAIL PROTECTED]
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: [EMAIL PROTECTED] (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).
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_regexp_pt1.html On 2003.09.22 21:24, Jacques Kilchoer wrote: >-Original Message- >From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 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: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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).
RE: Isnumeric question
>-Original Message- >From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 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: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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).
RE: Isnumeric question
Previously posted by Jared is the is_number function below:
You could avoid the decode statement and have the exception return zero for a
non-numeric parameter - of course you'd want to rename the function to something more
meaningful in that case.
"
-Original Message-
Sent: Saturday, 1 February 2003 8:05 AM
To: Multiple recipients of list ORACLE-L
create or replace function is_number( chk_data_in varchar2 )
return boolean
is
dummy number(38,4);
begin
dummy := to_number(chk_data_in);
return true;
exception
when value_error then
return false;
when others then
raise;
end;
/
show errors function is_number
declare
v_test varchar2(10) := '1E';
begin
if is_number(v_test) then
dbms_output.put_line(v_test || ' is a number');
else
dbms_output.put_line(v_test || ' is NOT a number');
end if;
end;
/
"
HTH,
Bruce Reardon
-Original Message-
Sent: Tuesday, 23 September 2003 11:00 AM
On 2003.09.22 20:15, Teresita Castro wrote:
> Hi!!
> 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?
>
my $line_comment;
my $sth=$dbh->prepare("Select line_comment from");
$sth->execute();
$sth->bind_col(1,\$line_comment);
while ($sth->fetchrow_array() {
if ( $line_comment =~ /^[0-9]+/) {..}
}
--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author: Reardon, Bruce (CALBBAY)
INET: [EMAIL PROTECTED]
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: [EMAIL PROTECTED] (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).
Re: Isnumeric question
On 2003.09.22 20:15, Teresita Castro wrote:
Hi!!
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?
my $line_comment;
my $sth=$dbh->prepare("Select line_comment from");
$sth->execute();
$sth->bind_col(1,\$line_comment);
while ($sth->fetchrow_array() {
if ( $line_comment =~ /^[0-9]+/) {..}
}
--
Mladen Gogala
Oracle DBA
--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author: Mladen Gogala
INET: [EMAIL PROTECTED]
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: [EMAIL PROTECTED] (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).
