How to restrict entering alphabet into text box [message #232022] |
Thu, 19 April 2007 02:00 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
habib.khan
Messages: 20 Registered: March 2007 Location: Islamabad
|
Junior Member |
|
|
Hello every one,
i am using oracle 10g,i have a column cnic in employee table with data type is varchar2.i want to programatically restrict entering text and other simbols except - . User can only inter numeric value and - .
how i can solve this proble.Any one who can solve this problem,please tell me in which way i can do this.
Thanks in advance.
habib khan
[Updated on: Thu, 19 April 2007 02:02] Report message to a moderator
|
|
|
|
|
Re: How to restrict entering alphabet into text box [message #239362 is a reply to message #232022] |
Tue, 22 May 2007 02:32 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
mustaf_82
Messages: 20 Registered: May 2007 Location: UAE
|
Junior Member |
|
|
Try This...
Paste this code on When-Validate-Item trigger.
declare
chk_str varchar2(2);
len_str number(10);
begin
if :party_tel is not null then
len_str:=length(:party_tel);
for a in 1.. len_str loop
chk_str:=substr(:party_tel,a,1);
if ascii(chk_str) not in (45,48,49,50,51,52,53,54,55,56,57) then
message('Plz Enter The Valid No');
message('Plz Enter The Valid No');
raise form_trigger_failure;
end if;
end loop;
end if;
end;
|
|
|