Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle For Fun
Jeff wrote:
> In article <1075682270.753428_at_yasure>, Daniel Morgan <damorgan_at_x.washington.edu> wrote:
>
>
>>The contestants and results can be found at: >>http://www.psoug.org/sql_fun.html >> >>One lesson comes through very clearly from the results ... test, test, >>test. Don't be too quick to think you know what's best just by looking >>at the code you've written.
One could also handle NULLS with:
CREATE OR REPLACE FUNCTION translate3(p_code VARCHAR2 DEFAULT 'x')
RETURN BOOLEAN IS
BEGIN
RETURN translate(p_code,'0123456789','9999999999')='999-999-9999';
END translate3;
/
Which is cleaner still.
-- Daniel Morgan http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp damorgan_at_x.washington.edu (replace 'x' with a 'u' to reply)Received on Mon Feb 02 2004 - 18:14:20 CST