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

Provide name object and parameter when problem in parameter of sp/function and uniform format of error [CORE5906] #6164

Open
firebird-automations opened this issue Sep 5, 2018 · 0 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Maxim Kuzmin (cybermax)

Votes: 1

When occurs error in input/output parameters of SP/Function, error message non informative or show part of information.

CREATE OR ALTER PROCEDURE TEST_SP (
IN_DATE DATE NOT NULL,
PARAM VARCHAR(10) NOT NULL)
RETURNS (
RESULT INTEGER)
AS
DECLARE VARIABLE VR VARCHAR(5);
BEGIN
RESULT = :PARAM;
VR = :PARAM;
SUSPEND;
END

Example 1:
SELECT RESULT FROM TEST_SP('31.02.2018', '1234567890')

Overflow occurred during data type conversion.
conversion error from string "31.02.2018".

Example 2:
SELECT RESULT FROM TEST_SP(CURRENT_DATE, '12345678901')
Arithmetic overflow or division by zero has occurred.
arithmetic exception, numeric overflow, or string truncation.
string right truncation.
expected length 10, actual 11.

Example 3:
SELECT RESULT FROM TEST_SP(CURRENT_DATE, NULL)

The insert failed because a column definition includes validation constraints.
validation error for variable PARAM, value "*** null ***".
At procedure 'TEST_SP'.

Example 4:
SELECT RESULT FROM TEST_SP(CURRENT_DATE, 'qqq')

Overflow occurred during data type conversion.
conversion error from string "qqq".
At procedure 'TEST_SP' line: 9, col: 5.

Example 5:
SELECT RESULT FROM TEST_SP(CURRENT_DATE, '123456')

Arithmetic overflow or division by zero has occurred.
arithmetic exception, numeric overflow, or string truncation.
string right truncation.
expected length 5, actual 10.
At procedure 'TEST_SP' line: 10, col: 5.

In examples 1 and 2, unknown name of SP.
In examples 1, 2, 4 and 5, unknown name of parameter.
Sometimes it's make find reason of error is hard. And it takes a lot of time to finding name of parameter, where error occurred.
Here need extend info about a place and show is in uniform format, like:

Example 1:
Overflow occurred during data type conversion.
conversion error from string "31.02.2018".
At input parameter 'IN_DATE' of procedure 'TEST_SP'.

Example 2:
Arithmetic overflow or division by zero has occurred.
arithmetic exception, numeric overflow, or string truncation.
string right truncation.
expected length 10, actual 11.
At input parameter 'PARAM' of procedure 'TEST_SP'.

Example 3:
The insert failed because a column definition includes validation constraints.
Value "*** null ***".
At input parameter 'IN_DATE' of procedure 'TEST_SP'.

Example 4:
Overflow occurred during data type conversion.
conversion error from string "qqq".
At output parameter 'RESULT' of procedure 'TEST_SP' line: 9, col: 5.

Example 5:
Arithmetic overflow or division by zero has occurred.
arithmetic exception, numeric overflow, or string truncation.
string right truncation.
expected length 5, actual 10.
At variable 'VR' of procedure 'TEST_SP' line: 10, col: 5.

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