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

    Unanswered: Trigger and strings

    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
    Jul 2001
    Location
    Germany
    Posts
    189

    Lightbulb

    Hello,

    one way is to create a trigger and scan the fields for the "unwanted"
    characters.

    Use the INSTR Function to scan a string for special characters.

    The best trigger type is the before insert trigger. If the character has contains "unwanted" characters - throw an exception.

    In your application you can catch the ORA Exception an print out a message or something else ...

    Hope that helps ?

    Regards

    Manfred Peter
    (Alligator Company)
    http://www.alligatorsql.com

  3. #3
    Join Date
    Aug 2001
    Location
    Philadelphia, PA
    Posts
    3
    Thanks, that's exactly what I needed to know.

    Thanks

Posting Permissions

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