I'm basically translating all alpha characters to spaces, and then trimming them out,which of course, leaves everything else. Then I check for a length. Remove the UPPER if you don't want lower case.
Create Table TestalphaIn 10G, you can use the REGEXP functions:
(Alphaonly Varchar2(10)
Constraint Ck_Alphaonly Check
(Length
(Trim
(Translate
(Upper(alphaonly),
'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
' '
)
)
) is null
)
);
Create Table Testalpha
(Alphaonly Varchar2(10)
Constraint Ck_Alphaonly Check
(Regexp_Like(AlphaOnly, '^[[:alpha:]]+$')
)
);
No comments:
Post a Comment