Skip to main content

mssql sql code table (sqlcode -4001)

  • April 19, 2019
  • 2 replies
  • 0 views

Hi,

where I can find sqlcode of microsoft sql?

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

thank bye


#EnterpriseDeveloper

2 replies

Chris Glazier
Forum|alt.badge.img+2
  • Moderator
  • 3696 replies
  • April 19, 2019

Hi,

where I can find sqlcode of microsoft sql?

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

thank bye


#EnterpriseDeveloper

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?

 


  • 0 replies
  • April 23, 2019

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?

 

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