L
L
lol1990lol19902014-07-16 13:12:03
firebird
lol1990lol1990, 2014-07-16 13:12:03

FB2.5 Trigger - How to trim all strings in a column to 70 characters long?

Help writing a trigger. The table contains rows, one of the columns contains text from 1 to 81 characters. It is necessary that the field be cut off to 70 characters if this column has more than 70 characters. PLZ HELP

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Viktor Koltcov, 2014-07-16
@lol1990lol1990

In the trigger BeforeInsert and BeforeUpdate write
more about SUBSTRING
http://firebirdsql.su/doku.php?id=substring&s[]=su...

L
lol1990lol1990, 2014-07-16
@lol1990lol1990

beforeinsert and beforeupdate wrote
AS
begin
new.NAME = substring(new.NAME from 1 for 70);
end
ticks insert delete update did not touch
clicked lightning (compile), saved
but the number of characters does not change

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question