I.T. Discussion Community!
-Collapse +Expand
DBA
Search DBA Group:

Advanced
-Collapse +Expand DBA Store
PRESTWOODSTORE

Prestwood eMagazine

March Edition
Subscribe now! It's Free!
Enter your email:

   ► MB LobbyDBA, Databases, & Data BoardInterbase Topic   Print This     

Check in trigger

Check in trigger in Interbase topic (part of our DBA, Databases, & Data group).

Quick Search: trigger   Check trigger  
Royke74
 (Inactive)
-- USA
Hi there,

Can anyone tell me how to check for a string length in a trigger (BEFORE INSERT). Something like this. It should be simple but i cannot find anything about this in (online)help.

CREATE TRIGGER check_user_length FOR INLOGGEN
BEFORE INSERT AS
BEGIN
IF LENGTH(name) > 15) THEN EXCEPTION wrong_user_length;
END

Thanks!
 Posted 19 years ago (Thread Starter)
Comment Quote
About Royke74 -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #5793, 2 replies
Thread Started 4/11/2002 7:43:00 AM
View Counter=3339
Last Reply Posted 4/16/2002 2:02:00 AM)
Location=-- USA 
Joined=19 years ago   MB Posts=2  
Simon Wood
 (Inactive)
UK
try this :

==========================================
CREATE TRIGGER LOGGEDIN_CHECK FOR LOGGEDIN
ACTIVE BEFORE INSERT POSITION 0
AS

DECLARE VARIABLE TString VARCHAR(15);

BEGIN


BEGIN
TString = CAST(New.Name AS VARCHAR(15));
WHEN ANY DO
EXCEPTION Wrong_User_Length;

END

END ^
=========================================
Regards

Simon Wood
 Posted 19 years ago
Comment Quote
About Simon Wood -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #5862 (Level 1.1)  Reply to 5793
Thread Started 4/16/2002 12:49:00 AM
View Counter=2
Location=UK  
Joined=19 years ago   MB Posts=10  
Most Recent Post
Royke74
 (Inactive)
-- USA
Thanks Simon i'll try it!
 Posted 19 years ago (Thread Starter)
Comment Quote
About Royke74 -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #5864 (Level 1.2)  Reply to 5793
Reply Posted 4/16/2002 2:02:00 AM
Location=-- USA 
Joined=19 years ago   MB Posts=2  

Revive Thread!

Add a comment to revive this old thread and make this archived thread more useful.

Write a Comment...
Full Editor
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P123A1
Enter key:
Icon: A Post    Thread    Idea    Important!    Cool    Sad    No    Yes    Includes a Link...   
Thread #5793 Counter
3339
Since 4/2/2008

Follow PrestwoodBoards on: 


©1995-2021 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech