Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2009
    Posts
    5

    Unanswered: Validating input (not number) - help pls

    I am working on Oracle Forms Builder 6i and I want to validate input of field that should contain Char input but not numbers. Which trigger to use? (WHEN-VALIDATE-ITEM)?

    IF :BLOCKname.FIELDNAME (xxnot numberxxwhat to write herexx) THEN
    MESSAGE (‘Invalid input’);
    MESSAGE (‘UP’);
    ELSE
    DO_KEY (‘COMMIT_FORM’);
    GO_BLOCK (‘BLOCKname’);
    END IF;

  2. #2
    Join Date
    May 2009
    Posts
    5
    What you want is to insure that it does not contain the characters 0123456789 right? Then
    Code:
    if translate(fieldname,'A0123456789','A') != fieldname
    then
      INVALID
    else
      GOOD
    end if;
    If you want to insure that it contains only the characters abcdefghijklmnopqrstuvwxyz (upper or lower case) then
    Code:
    if translate(fieldname, '_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',  '_') is not null
    then
      INVALID
    else
      GOOD
    end if;
    And yes, it goes in the WHEN_VALIDATE_ITEM trigger.

    And

Posting Permissions

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