Problem with long column names

Hello,

I just discovered this problem: we have created a column with a name longer than 50 characters (I know that’s unusual). Servoy did not seem to have a problem and created that column fine.

Now we wanted to update our repository by importing that solution. The tables in question had to be created. Now Servoy complains that there is no column by that name and it could not create one.

When I checked the table, I saw that the column was created but also a shorter version. The secret probably lies in the repository. The column “columname” of table “servoy_columninfo” is only 50 characters long. It seems that the tables are created right from XML, so everything is fine. But when comparing the table to the columninfo, Servoy gets confused.

Can that be fixed of is there a limitation of 50 characters field names?

Thanks
Patrick

Patrick,

There is currently a limit of 50 characters for column and table names in Servoy.
Creation of that column name should not have been accepted by developer.

The reason for the limit is that solutions need to work on all databases and not all databases support such long names.

Servoy 3.1 beta 4 will contain a few changes regarding long table or column names:

  • the maximum name length for tables and columns is reduced to 30
  • developer will not allow you to enter longer names (they are cut off now)
  • long names in existing solutions or created through import or via existing tables are accepted

This fix should allow you to import your solution with long column names.
Obviously, it won’t work if the database you are using does not support the long names.

Rob

Good approach, I would say. In general, I think, nobody should really use table or column names longer than 30 characters, since the largest DB vendor cannot handle it (and some others as well). We are very careful about that in general, except that one project where we have a Postgres DB and very complicated naming conventions…

rgansevles:
Servoy 3.1 beta 4 will contain a few changes regarding long table or column names:
the maximum name length for tables and columns is reduced to 30

Hi Rob,

do you think you could implement this feature as an option? So the developer will be able to decide, if he wants not to be able to specify column names which are longer than 30 characters.
Or another option: If the table already contains column names longer than 30 characters, servoy will not check anymore if a new column name is longer.

Thanks for your feedback.

Christoph

Christoph,

In general, Servoy solutions need to be portable across all main jdbc-compliant databases.

For a developer to override this max length you can add a feature request on the servoy website.

Rob

Hi All

I do not think long names, e. g. more than 50 characters are very unusal! If one sticks to some conventions and uses attribute names a clear as possible, one can get quite quickly long names. To me, the problem lies in databases not supporting long names. I mean, would we discuss if it’s acceptable for an operating system to support only names up to 30 characters! Not today any more, it’s a thing of the past. so the question to me is, when will databases cut todays limitations of <= 30 characters? Has anybody an idea if the next version of Oracle will still have the 30 character limit?
By the way, it would be very helpful to have a list of databases with the according limitations in this respect. Does anyone have such a comparison?

To Servoy: Wouldn’t it be suffice to just give an warning message if a column name is longer than 30 characters instead of preventing the name to enter. You are limiting all developers not affected with the limit!

Thanks and best regards, Robert

rgansevles:
Patrick,

There is currently a limit of 50 characters for column and table names in Servoy.
Creation of that column name should not have been accepted by developer.

The reason for the limit is that solutions need to work on all databases and not all databases support such long names.

Servoy 3.1 beta 4 will contain a few changes regarding long table or column names:

  • the maximum name length for tables and columns is reduced to 30
  • developer will not allow you to enter longer names (they are cut off now)
  • long names in existing solutions or created through import or via existing tables are accepted

This fix should allow you to import your solution with long column names.
Obviously, it won’t work if the database you are using does not support the long names.

Rob

To Servoy: Wouldn’t it be suffice to just give an warning message if a column name is longer than 30 characters instead of preventing the name to enter. You are limiting all developers not affected with the limit!

Consider this scenario:

1-- Joe Developer creates a column with a 53-character name. A warning pops up but he proceeds anyway. The back end is a platform that can handle this long name.

2-- Joe Developer’s supervisor bought into Servoy because, among other good reasons to use it, the company could license a different back end some day rather than being locked in to their current licensing deal. And some day that indeed comes to pass: the company has grown and has decided to go with Oracle as its “big iron” database. Joe exports the solution from the old server & imports to the new. Things break.

In all things, I (and I’m sure the huge predominance of Servoy dev’s) vote for back-end interoperability far above giving developers options that will cause known problems on platforms Servoy is supposed to play well with.

kazar

PS: The comparison of the length of document filenames (that are created by, and that need to be easily understood by, “the average computer user”) with the length of column names (that are created by and that need to be understood by, programmers), seems a bit “stretched” to me … pun perhaps intended.

Hi Ilyse

To me Servoy is a developing environment one has to understand quite a lot of (different) things, like programming languages, client-server concepts, event handling, and especially one has to have knowledge about a SQL database, so I never assumed and do not so today (as I know quite bit more about Servoy .-)
This is in my opinion not a toy tool just to do something without knowing what one does, this is certainly a tool for developers who know (or are willing to spend quite some time to learn) what they do - but I may be wrong.
So I don’t think supporting some (existing, little or no knowledge?) developers should have more priority than not limiting ordinary developers. But, this is only my opinion :-)

Best regards, Robert

kazar:

To Servoy: Wouldn’t it be suffice to just give an warning message if a column name is longer than 30 characters instead of preventing the name to enter. You are limiting all developers not affected with the limit!

Consider this scenario:

1-- Joe Developer creates a column with a 53-character name. A warning pops up but he proceeds anyway. The back end is a platform that can handle this long name.

2-- Joe Developer’s supervisor bought into Servoy because, among other good reasons to use it, the company could license a different back end some day rather than being locked in to their current licensing deal. And some day that indeed comes to pass: the company has grown and has decided to go with Oracle as its “big iron” database. Joe exports the solution from the old server & imports to the new. Things break.

In all things, I (and I’m sure the huge predominance of Servoy dev’s) vote for back-end interoperability far above giving developers options that will cause known problems on platforms Servoy is supposed to play well with.

kazar

PS: The comparison of the length of document filenames (that are created by, and that need to be easily understood by, “the average computer user”) with the length of column names (that are created by and that need to be understood by, programmers), seems a bit “stretched” to me … pun perhaps intended.

To Servoy: Wouldn't it be suffice to just give an warning message if a column name is longer than 30 characters instead of preventing the name to enter. You are limiting all developers not affected with the limit! 

The warning (column names over 30) is already included in upcoming release.
A possibility to stretch the limit from 30 to 50 could be added as a feature.

Rob

Hi Robert

Personally, as i said, I prefer a warning to being unable to enter (in Servoy Developer) a long column name, for the previously detailed reasons (The 30 column limit will not stay forever .-)
What if you put a “long” coliumn name in orange (as the ample, to say take care :-), as you do already put “dangerous” column names in red to flag them as may be inapropriate? That would be a remainder that the column name may be dangerous/invalid for some databases.
Working with colours seems to me a good thing as long as you can keep the colour scheme consistent accross Servoy Developer. And that would make the 50 column strech limit unnecessary. What do you think?

Thanks for your feedback, Robert

rgansevles:

To Servoy: Wouldn't it be suffice to just give an warning message if a column name is longer than 30 characters instead of preventing the name to enter. You are limiting all developers not affected with the limit! 

The warning (column names over 30) is already included in upcoming release.
A possibility to stretch the limit from 30 to 50 could be added as a feature.

Rob