Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report name and fact/max length of name of database objects when length exceeding [CORE5903] #6161

Open
firebird-automations opened this issue Aug 28, 2018 · 5 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Maxim Kuzmin (cybermax)

Votes: 2

When creating various object of database and length thier names exceeding maximal, get error.

Example for package:
CREATE OR ALTER PACKAGE VERY_VERY_LONGEST_NAME_OF_PACKAGE
AS
BEGIN

END

Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Name longer than database column size.

Example for table:
CREATE TABLE VERY_VERY_LONGEST_NAME_OF_TABLE1 (
NEW_FIELD INTEGER)

Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Name longer than database column size.

Example for exception:
CREATE EXCEPTION VERY_VERY_LONGEST_NAME_OF_EXCEPTION

Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Name longer than database column size.

From the message, neither the object type, nor its name, nor its actual length is understood. Sometimes, in executing script or other work, it's causes inconvenience.
Propose extending error message like this:

Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Name longer than database column size.
Length name of package "VERY_VERY_LONGEST_NAME_OF_PACKAGE" exceed maximum 31 chars on 2 (fact 33);

Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Name longer than database column size.
Length name of table "VERY_VERY_LONGEST_NAME_OF_TABLE1" exceed maximum 31 chars on 1 (fact 32);

@firebird-automations
Copy link
Collaborator Author

Commented by: Sean Leyne (seanleyne)

I don't think it is necessary to report the number of characters that the length exceeds by, the message details should make that obvious.

As for the text of the error message, something more like this would read better:
Length name of {Object Type} "{Object Name}" ({Length value}) exceeds maximum of {Max Length},

Eg:
Length name of Table "VERY_VERY_LONGEST_NAME_OF_TABLE1" (32) exceeds maximum of 31

@firebird-automations
Copy link
Collaborator Author

Commented by: @livius2

Maybe better
Eg:
Name of Table "VERY_VERY_LONGEST_NAME_OF_TABLE1" (32) exceeds maximum Length of 31

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

I'd leave the character counting up to users:
Metadata (or <object>) name "VERY_VERY_LONGEST_NAME_OF_TABLE1" exceeds maximum supported length (31 characters)

@firebird-automations
Copy link
Collaborator Author

Commented by: Sean Leyne (seanleyne)

@dmitry,

If we have the length, what is the harm in providing the value? (It let's the user know by how much the name needs to be trimmed)

_Accurately_, counting 31 characters is one thing, counting 60+ is another.

@firebird-automations
Copy link
Collaborator Author

Commented by: Maxim Kuzmin (cybermax)

@dmitry Yemanov,

As @sean Leyne already said, knowledge of the actual length or the number of characters of the excess, simplifies the name adjustment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant