If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > Trigger and strings

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-30-02, 14:58
coleex coleex is offline
Registered User
 
Join Date: Aug 2001
Location: Philadelphia, PA
Posts: 3
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
Reply With Quote
  #2 (permalink)  
Old 07-31-02, 06:26
alligatorsql.com alligatorsql.com is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 07-31-02, 16:06
coleex coleex is offline
Registered User
 
Join Date: Aug 2001
Location: Philadelphia, PA
Posts: 3
Thanks, that's exactly what I needed to know.

Thanks
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On