Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2001
    Location
    Philadelphia, PA
    Posts
    3

    Red face Unanswered: Triggers and constraints

    Hello all,

    I need to be able to block users from entering certain punctuation markes into oracle through the application I support. I wish to do this inside Oracle directly. How can I create a trigger or a constraint which will not allow users to enter unwanted characters? How can I do this on most of the application tables in the database?

    Thanks,
    Eric

  2. #2
    Join Date
    Jun 2002
    Location
    Indianapolis
    Posts
    21
    Use the translate function.

    You will need at least one valid character in the allowed set.
    Here is an example from the Oracle docs:

    SELECT TRANSLATE('2KRW229',
    '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ', '0123456789')
    "Translate example"
    FROM DUAL;

    Translate example
    -----------------
    2229


    hth
    -Brice

Posting Permissions

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