When-Validate-Item [message #533326] |
Tue, 29 November 2011 08:09 |
|
ShaneS
Messages: 2 Registered: November 2011
|
Junior Member |
|
|
I am currently having trouble validating the item Vehicle_Reg_No
I have to ensure that it starts with a letter and ends with a number. The code below gives me the TRUCK_START but for every other scenario the form throws an unhandled exception. Any assistance will be appreciated.
DECLARE
TRUCK_START VARCHAR2(100);
TRUCK_END VARCHAR2(100);
NUM_ALERT NUMBER;
BEGIN
IF :M_ORDER_ITEMS.VEHICLE_REG_NO IS NOT NULL THEN
truck_start := substr (:M_ORDER_ITEMS.VEHICLE_REG_NO,1,1);
truck_end := substr (:M_ORDER_ITEMS.VEHICLE_REG_NO,-1,1);
truck_start:= to_number(truck_start,0);
truck_end := to_number(truck_end,0);
if((truck_start >=65 AND truck_start <=90) OR (truck_start >=97 AND truck_start <=122)and
(truck_end >=0 and truck_end <=9))then
message ('correct');
elsIF(not((truck_start >=65 AND truck_start <=90) OR (truck_start >=97 AND truck_start <=122)))THEN
MESSAGE(TRUCK_START);
elsIF(not (truck_end >=48 and truck_end <=57))THEN
MESSAGE(TRUCK_END);
END IF;
END IF;
END;
[Updated on: Tue, 29 November 2011 08:11] Report message to a moderator
|
|
|
|
|