"jmaxsherkimer" <jm***********@hotmail.com> wrote in message
news:f8**************************@posting.google.c om...
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