Date Validation in PRE-INSERT Trigger [message #576144] |
Fri, 01 February 2013 00:12 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](//www.gravatar.com/avatar/ad43f1371bcac6ec2f5488add90a6c4a?s=64&d=mm&r=g) |
praveen240881
Messages: 36 Registered: February 2012
|
Member |
|
|
Dear Experts
Need your guidance please. In the attached PRE-INSERT Trigger Code i need to do a validation.
Validatation:
If the Date range is between FEB 6 2013 and MARCH 1 2013 then the code should work
ELSE
It should throw a message
Can you please let me know how can i accomplish this.
Regards
Praveen
Check_Product_Title;
Begin
if :prod2.internet_product_flag = 'Y' and :prod2.brnd_code is null then
soft_messages('E',TRUE,'Brand code must be specified for CCH online product');
end if;
end;
BEGIN
IF :PROD2.GAA_AVAIL IS NULL THEN
:PROD2.GAA_AVAIL :='N';
END IF;
END;
BEGIN
IF (:prod2.GAA_AVAIL = 'Y' AND :prod2.INTERNET_PRODUCT_FLAG = 'N' )
THEN
soft_messages('E', TRUE, 'The Available in GAA flag can only be set to Yes if the CCH Canadian Online Product flag is set to Yes');
END IF;
END;
begin
if :prod2.GAA_AVAIL='Y' then
set_item_property('prod2.GAA_AVAIL',enabled,property_false);
else
set_item_property('prod2.GAA_AVAIL',enabled,property_true);
end if;
end;
BEGIN
Check_printable_item_flag;
:PROD2.CREATED_BY := :CG$CTRL.CGU$USER;
:PROD2.CREATED_DATE := SYSDATE;
IF :PROD2.DELIVERY_HANDLING_CHARGE_FLAG = 'Y'
AND :PROD2.PRODUCT_TYPE IN ('BOOK','SE','PD','BVOL','BINC')
AND :PROD2.SHIPPING_CHARGES_SCHEME IS NULL
THEN
soft_messages ('W',TRUE,'The Scheme is mandatory for this product type when Shipping Charges Flag is Yes ');
END IF;
IF :PROD2.PRODUCT_TYPE='ADDL' AND :PROD2.PRMU_CODE IS NULL
THEN
soft_messages ('E',TRUE,'Multi User Pricing Group is mandatory for Additional product type');
END IF;
END;
|
|
|
|
|
|