Results 1 to 2 of 2

Thread: Between values

  1. #1
    Join Date
    Jun 2004
    Posts
    42

    Unanswered: Between values

    hi,
    i have a field for entering salaries,and another field that i choose the range of salary from.i need to write a validation trigger to check if the salary i'm writing falls in the range.

    if :block.sal_range = '1-1000' then
    block.salary between 1 and 1000;
    elsif
    :block.sal_cat:= '1001-5000' then
    block.salary between 1001 and 5000;
    end if;

    this way is not working ,can any one tell me what is the right way to do that.

    thanks.

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    You need to specify an action to take if the value is out of range, e.g.
    Code:
    if (:block.sal_range = '1-1000' and :block.salary NOT between 1 and 1000)
    or (:block.sal_range = '1001-5000' and block.salary NOT between 1001 and 5000)
    then
      message( 'Salary out of range ' || :block.sal_range );
      raise form_trigger_failure;
    end if;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •