Consultor Eletrônico



Kbase P34644: Error 'Bad arguments (7487)' using SQL-92 SUBSTRING function
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   31/07/2003
Status: Unverified

SYMPTOM(s):

Bad arguments (7487)

[DataDirectTechnologies][ODBC PROGRESS DRIVER][PROGRESS "Bad Argument(7487)]

Error occurs using an SQL-92 statement similar to:

SELECT * FROM pub.Customer WHERE SUBSTRING(Name,75, 1) = 'A'

CAUSE:

Referencing a position greater than the SQL-WIDTH of the field.

FIX:

Ensure that the positions of the character(s) being referenced are less or equal to the SQL-WIDTH of the field.

Thus, if the SQL-WIDTH of the Customer Name field is 60, then the statements:

SELECT * FROM pub.Customer WHERE SUBSTRING(Name,100, 1) = 'A';
SELECT * FROM pub.Customer WHERE SUBSTRING(Name,61, 1) = 'A';

would generate the above 'Bad arguments (7487)' error, because 100 and 61 are greater than the SQL-WIDTH of the Name field, while the statements:

SELECT * FROM pub.Customer WHERE SUBSTRING(Name,10, 1) = 'A';
SELECT * FROM pub.Customer WHERE SUBSTRING(Name,60, 1) = 'A';

would not generate the above error because both 10 and 60 are less or equal than the SQL-WIDTH of the Name field.