Feedback
 
Did this article resolve your question/issue?

   

Your feedback is appreciated.

Please tell us how we can make this article more useful. Please provide us a way to contact you, should we need clarification on the feedback provided or if you need further assistance.

Characters Remaining: 1025

 


Article

Error 7587 / 10713 occur when executing SQL query ending in a semicolon against a Progress / OpenEdge database.

« Go Back

Information

 
Article Number000032174
EnvironmentProduct: Progress
Version: 9.1D, 9.1E
Product: OpenEdge
Version: 10.x, 11.x
OS: All supported platforms
Other: ODBC
Question/Problem Description

Error 7587 / 10713 occur when executing a SQL Query with and ODBC client ending in a semicolon against a Progress / OpenEdge database.

SELECT * FROM pub.employee;


Problem does not occur with all SQL query tools: 

Using a JDBC client like sqlexp or WinSQL - query succeeds.
Using Crystal Reports 2008 (with SQL Command to pass a free-form query) - query fails.

Steps to Reproduce
Clarifying Information
Extracts from ODBC trace log and OpenEdge SQL engine logging showing success with WinSQL:

ODBC Trace - sends query to database:
Winsql          284-1128 ENTER SQLExecDirect 
HSTMT           00A62130
UCHAR *         0x00C23E50 [      -3] "select * from pub.employee\ 0"
SDWORD          -3

SQL engine logging - database receives query and prepares it successfully:
Preparing SQL Statement: select * from pub.employee
20120529_104546 6560:
Returning from sql_fn() with code: 0

ODBC Trace - returns from database with success:
Winsql          284-1128 EXIT  SQLExecDirect  with return code 0 (SQL_SUCCESS)
HSTMT           00A62130
UCHAR *         0x00C23E50 [      -3] "select * from pub.employee\ 0"
SDWORD          -3


Extracts from ODBC trace log and OpenEdge SQL engine logging showing failure with Crystal Reports 2008:

ODBC Trace - sends query to database:
 
crw32           c8c-a34 ENTER SQLExecDirectW 
HSTMT           091C2810
WCHAR *         0x03041B24 [      -3] "select * from pub.employee;\ 0"
SDWORD          -3
 
SQL engine logging - database receives query but fails with syntax error:  
 
Preparing SQL Statement: select * from pub.employee;
20120529_110951 3576:
Returning from sql_fn() with code: -210056
 
ODBC Trace - returns error from database:
 
crw32           c8c-a34 EXIT  SQLExecDirectW  with return code -1 (SQL_ERROR)
HSTMT           091C2810
WCHAR *         0x03041B24 [      -3] "select * from pub.employee;\ 0"
SDWORD          -3
DIAG [HY000] [DataDirect][ODBC Progress OpenEdge Wire Protocol driver][OPENEDGE]Syntax error in SQL statement at or about ";" (10713) (-210056) 
Error Message[DataDirect][ODBC PROGRESS driver][PROGRESS]Syntax error (7587)

[DataDirect][ODBC Progress OpenEdge Wire Protocol driver][OPENEDGE]Syntax error in SQL statement at or about ";" (10713) (-210056)
Defect/Enhancement Number
Cause
This is expected behavior.  The Progress / OpenEdge SQL-92 engine does not accept SQL queries via ODBC that are terminated with a semicolon, and reports a syntax error.
  • The utilities that reported a failure did not remove the semicolon before sending the query.
  • The utilities that executed the SQL query successfully had removed the semicolon from the query before sending it to the ODBC driver to the SQL engine (see SQL logging extract). 
Resolution
Remove the semicolon from the end of the SQL query.
Workaround

 
Notes
Some utilities (such as WinSQL) feature an option that allows users to specify a query terminator. For WInSQL, this is set to semicolon by default. 

The test with Crystal Reports 2008 does not imply a problem with that product; it is merely intended to show that some products/utilities send the SQL queries unaltered to the ODBC driver and therefore the OpenEdge SQL-92 engine. SQL queries generated by Crystal Reports itself do not use semicolons as query terminators.
Attachment 
Last Modified Date12/18/2018 8:29 AM