Re: basic plsql question

From: Jim Kennedy <kennedy-downwithspammersfamily_at_attbi.net>
Date: Fri, 27 Aug 2004 13:38:02 GMT
Message-ID: <_OGXc.191373$8_6.150323_at_attbi_s04>


"jmaxsherkimer" <jmaxsherkimer_at_hotmail.com> wrote in message news:f8606b97.0408270420.167b32fb_at_posting.google.com...
> i had a basic question on plsql, if i have a variable as varchar2,
> containing some text like 'A12345', how do i write a function to make
> sure that the first char. is the letter 'A' or 'a' and the next five
> characters are numbers? sorry about asking a basic question, but i'm
> not the dba here, he recently left and i'm just the web developer
> having to do this for now.
Look in the docs you can find documentation at otn.oracle.com. Look in the SQL Reference guide. (there are a ton of docs, but that is the one you want) You will probably use substr and translate. You can test it in sqlplus by

select substr('A12345',1,1) from dual;

etc.
That will allow you to evaluate the expression so you can test your function quickly. Once you are satisfied with your exprerssion you can put the expression in your code.
Jim Received on Fri Aug 27 2004 - 15:38:02 CEST

Original text of this message