Re: mysql lenght() and char_length not working for longer texts

From: Lennart Jonsson <erik.lennart.jonsson_at_gmail.com>
Date: Thu, 2 Jul 2015 18:59:31 +0200
Message-ID: <mn3qj0$fse$1_at_dont-email.me>


On 07/02/2015 07:15 AM, manoj_paramasivam_at_trimble.com wrote: [...]
> i want restrict my text column 'b' to throw message on lenght greater than 32766.
> But CHAR_LENGHT() is not working for such a large texts. here is my procedure. Any ideas?

Is there a problem declaring the column that way?

create table sample

(	a int not null
, 	b varchar(32766) not null )

You will get an error like:

ERROR 1406 (22001): Data too long for column 'b' at row 1

if the length of inserted value exceeds that of the column

/Lennart Received on Thu Jul 02 2015 - 18:59:31 CEST

Original text of this message