![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
* *Is there any way to get the maximum size of a VARCHAR column? Some function like "COLUMN_WIDTH(columname)", perhaps? * * LENGTH gives the size of the contents, not the size limit of the column, for VARCHAR columns. *The output from DESCRIBE requires parsing. *The intent is to find out if an item is too big before it goes into a file for a LOAD DATA INFILE and aborts the whole load. * * * * * * * * * * * * * * * * John Nagle |
#3
| |||
| |||
|
|
Is there any way to get the maximum size of a VARCHAR column? Some function like "COLUMN_WIDTH(columname)", perhaps? |
#4
| |||
| |||
|
|
On Jul 9, 2:06 pm, John Nagle<na... (AT) animats (DOT) com> wrote: Is there any way to get the maximum size of a VARCHAR column? Some function like "COLUMN_WIDTH(columname)", perhaps? LENGTH gives the size of the contents, not the size limit of the column, for VARCHAR columns. The output from DESCRIBE requires parsing. The intent is to find out if an item is too big before it goes into a file for a LOAD DATA INFILE and aborts the whole load. John Nagle I'm not sure what you are asking? |
|
The size of the varchar(_) column you can find through mysql query browser. You find it in the data structure. You can see the databases tables in the schema section. |
|
You click on your table and copy the create table contents to the clipboard then paste it into a query browser and you can see what the size of the field is. Look up file handling in the php manual |
#5
| |||
| |||
|
|
On Jul 9, 2:06*pm, John Nagle <na... (AT) animats (DOT) com> wrote: * *Is there any way to get the maximum size of a VARCHAR column? Some function like "COLUMN_WIDTH(columname)", perhaps? * * LENGTH gives the size of the contents, not the size limit of the column, for VARCHAR columns. *The output from DESCRIBE requires parsing. *The intent is to find out if an item is too big before it goes into a file for a LOAD DATA INFILE and aborts the whole load. * * * * * * * * * * * * * * * * John Nagle I'm not sure what you are asking? The size of the varchar(_) column you can find through mysql query browser. You find it in the data structure. *You can see the *databases tables in the schema section. You click on your table and copy the create table contents to the clipboard then paste it into a query browser and you can see what the size of the field is. If you mean you have to check that all the data *fits into that column you have to loop through the rows and check them using file handling routines. Look up file handling in the php manual to know how to read to and write to a file. *You have to read each row and put the data into an array to loop through the fields in the rows to check the data. |
![]() |
| Thread Tools | |
| Display Modes | |
| |