Discussion Locked

Oracle Forum (continued)

0 helpful
6 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Welcome to the Oracle Forum. This is the place to post your Orace questions, share your best techniques, and express your opinion on topics that impact IT development. We also encourage you to post your comments about the Oracle TechMail.

If you haven't subscribed to the Oracle TechMail, visit our e-newsletter subscription center to subscribe to this free e-newsletter:
http://nl.com.com/acct_mgmt.jsp?brand=builder

Also, visit the previous Oracle Forum to catch up on member comments:
http://builder.com.com/5208-6230-0.html?forumID=29&threadID=120657

Note: When pasting links into your browser, remember to remove any extra spaces that appear.

6 replies

by maryweilage

Reader Oleg Shamshura sent us the following feedback in response to the 11/5 Oracle e-newsletter entitled, "Create an isNumber function to validate numbers":

It's good to have such function. But, why so complicated? That's enough to have following:

CREATE OR REPLACE function IsNumber(test_str_in VARCHAR2) RETURN NUMBER IS
v_res NUMBER;
BEGIN
IF test_str_in IS NULL THEN
RETURN(NULL);
ELSE
v_res := TO_NUMBER(test_str_in);
RETURN(1);
END IF;
EXCEPTION
WHEN OTHERS THEN
RETURN(0);
END;

by maryweilage

Builder.com member Ted Lockwood sent us this feedback about the 11/5 e-newsletter:

After reviewing your isNumber function I believe there is a case that does not work.

If you pass the character string '+.01' to the function it returns a 0 invalid number.

SQL> select isnumber('+.01') from dual;

ISNUMBER('+.01')
----------------
0

It is a valid number since:

SQL> select to_number('+.01') from dual;

TO_NUMBER('+.01')
-----------------
.01

I made the following change to your function (marked in red) :

elsif l_state = 1 then -- first '+'/'-' state
l_next :=
translate(substr(s,i,1),'.0123456789','32222222222');
exit when l_next not in ('2','3');

I got the following result:

SQL> select isnumber('+.01') from dual;

ISNUMBER('+.01')
----------------
1

I appreciate your column and find it very informative. I hope this is helpful. Thank you.

by maryweilage

Note from the editor: In response to the Jan. 21, 2004 edition of the Oracle e-newsletter, "Enable PHP support on Oracle's default Apache server," Builder.com member Glenn Butler sent us the following comments and question:

"Excellent article. I've been developing J2EE on 8i and now 9i. I've been curious and bought a book on PHP/MySQL. Since the Oracle backend is basically a bit bucket on J2EE as well as PHP doesn't it make more economical sense to use MySQL. I'm hearing some great things about it's capabilities. Is there a resource for comparing MySQL to Oracle?"

by maryweilage

Oracle e-newsletter author Scott Stephens provided this response to Mr. Butler's question:

"Sure, here is a pretty extensive and honest comparison between MySQL, Oracle8, and PostgreSQL by a physics lab:
http://www-css.fnal.gov/dsg/external/freeware/mysql-vs-pgsql.html

Besides that, you really need to consider what your needs are, MySQL is cheap, fast and doesn't require much hardware to be used as a datastore, but lacks some stored procedures/triggers that helps move application logic out of the application and into the database."

by swstephe

In my article about iSQL*Plus vulnerability, it seems that many e-mails did not contain the complete text of my "hacker example". It should have read:

http://127.0.0.1/isqlplus?action=

Type this URL into a browser on a machine with a running instance of Oracle 9i with Apache and iSQL*Plus.

This discussion is closed to new replies.