Home mysql Specific string length in SQL

Specific string length in SQL

Author

Date

Category

How to set the parameter of the cell so that information is recorded there when you import data if its length is equal to exactly five characters and starts at a certain number, for example 2?


Answer 1

create trigger check_available
BEFORE INSERT ON TABLE
For Each Row
Begin.
  SELECT if.stringcolunm & lt; & gt; 5 and substring (new.stringcolunm, 1, 1) & lt; & gt; 2) Then.
   Set new.stringcolunm = ''
  END IF;
End.

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions