mf_galberico1 Honored Contributor.
Honored Contributor.
248 views

mssql sql code table (sqlcode -4001)

Jump to solution

Hi,

where I can find sqlcode of microsoft sql?

cobol application with ESQL have SQLCODE -4001 what's mean?

thank bye

0 Likes
1 Solution

Accepted Solutions
Micro Focus Expert
Micro Focus Expert

Re: mssql sql code table (sqlcode -4001)

Jump to solution

This is not an OpenESQL return code. They can be found listed here:

It would then be an actual error code being returned from the SQL Server ODBC driver but I cannot find -4001 documented anywhere.

Is there a text message being returned in the SQLCA field called SQLERRMC?

On what statement is this being returned and for which ODBC driver version?

 

2 Replies
Micro Focus Expert
Micro Focus Expert

Re: mssql sql code table (sqlcode -4001)

Jump to solution

This is not an OpenESQL return code. They can be found listed here:

It would then be an actual error code being returned from the SQL Server ODBC driver but I cannot find -4001 documented anywhere.

Is there a text message being returned in the SQLCA field called SQLERRMC?

On what statement is this being returned and for which ODBC driver version?

 

Highlighted
mf_galberico1 Honored Contributor.
Honored Contributor.

Re: mssql sql code table (sqlcode -4001)

Jump to solution

I have insert the display of MFSQLMESSAGETEXT: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Cannot insert duplicate key row in object 'dbo.TBIOGT' with unique index 'IBIOGT00'. The duplicate key value is (CY5312?).

the input file has two differebt key 

CY5312?
CY5312£

the second key becames like the first after exec sql insert 

"CY5312£" --> "CY5312?"

and give duplicate key.

In cobol display I have "£", while in sql statement with ESQL odbc (microsoft sql server for linux) becames "?"

this generates the double key.

now I have to understand why the odbc driver changes the "£" character to "?"

Likely this is a character encoding problem of microsoft sql server odbc driver for red hat linux.

bye

 

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.