Home » SQL & PL/SQL » SQL & PL/SQL » urgent!
urgent! [message #4439] Tue, 10 December 2002 00:10 Go to next message
maha
Messages: 11
Registered: November 2000
Junior Member
Using oracle forms 6i, my question is as the following:
Account number must have 10 digits, the first three digits can either be 110 or 115.
So, I used the following code:
declare
alert number;
x number;
account_number TBL_1460ACCOUNT_DETAILS.ACCOUNT_NUMBER%type;
begin
x:=substr(account_number,1,3);
if x=110 then
set_alert_property('SHOW_ALERT', title, 'invalid account number');
set_alert_property('SHOW_ALERT',alert_message_text, 'your account number must begin with 110 or 115');
set_alert_button_property('SHOW_ALERT',alert_button1, label,'ok');
alert:=show_alert('SHOW_ALERT');

end if;

end;
the trigger is in when validate item in Account_no field.
this is incomplete, can anybody help me please?!!
Re: urgent! [message #4461 is a reply to message #4439] Wed, 11 December 2002 13:45 Go to previous message
Dhiren
Messages: 43
Registered: July 2002
Member
you can give the following conditions in your code:

if length(account_number) != 10 then
set_alert_property('SHOW_ALERT', title, 'Acct not having 10 ');
show_alert......
else
if substr(account_number,1,3) != '110' or
substr(account_nimber,1,3) !='115' then
show_alert....
end if;
Previous Topic: Selecting a date part and ordering by date
Next Topic: Fetch out of Sequence error
Goto Forum:
  


Current Time: Wed May 15 20:11:40 CDT 2024