Check in trigger

Check in trigger in Interbase topic (part of our DBA, Databases, & Data group).
Quick Search:
trigger
Check trigger
|
|
Royke74
|
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)
|
|
About Royke74 |
|
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
|
|
 |
|
Simon Wood
|
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
|
|
About Simon Wood |
|
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
|
|
 |
Most Recent Post
|
Royke74
|
Thanks Simon i'll try it!
|
Posted 19 years ago (Thread Starter)
|
|
About Royke74 |
|
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
|
|
Revive Thread!
Add a comment to revive this old thread and make this archived thread more useful.
Thread #5793 Counter |
3339 |
Since 4/2/2008
|
|
|
|