Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: No idea how to solve : '[FireDAC][Phys][ODBC][sqlncli11.dll] SQL_NO_DATA' ?


This question is answered.


Permlink Replies: 3 - Last Post: May 2, 2017 1:18 AM Last Post By: Bernd Maierhofer
Maxime Bonin

Posts: 61
Registered: 1/23/17
No idea how to solve : '[FireDAC][Phys][ODBC][sqlncli11.dll] SQL_NO_DATA' ?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 27, 2017 1:42 PM
I use FireDAC with Microsoft SQL Server Express 2014

I get an '[FireDAC][Phys][ODBC][sqlncli11.dll] SQL_NO_DATA' error when specific TDataSet in my code calls POST

SQL Profiler shows that it happens after an UPDATE query has been sent to Microsoft SQL Server 2014 Express.

The error seems to show up in FireDAC.Phys.ODBCWrapper.FireDAC.Phys.ODBCWrapper.TODBCCommandStatement.Execute :

Here, the variable iRet is of type SQLReturn

 iRet := Lib.SQLExecDirect(FHandle, PSQLChar(AExecDirectCommand), SQL_NTS);


When iRet = 100, it means that the problem is SQL_NO_DATA, but I saw that sometimes an value of 100 doesn't raise an error.

I can't step into the SQLExecDirect function to see what this function do ... :S

What does 'no sql data' means ? Is my UPDATE query supposed to return something ??
Bernd Maierhofer

Posts: 161
Registered: 9/27/99
Re: No idea how to solve : '[FireDAC][Phys][ODBC][sqlncli11.dll]SQL_NO_DATA' ?
Correct
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 28, 2017 2:29 AM   in response to: Maxime Bonin in response to: Maxime Bonin
Maxime Bonin wrote:

I use FireDAC with Microsoft SQL Server Express 2014

I get an '[FireDAC][Phys][ODBC][sqlncli11.dll] SQL_NO_DATA' error
when specific TDataSet in my code calls POST

SQL Profiler shows that it happens after an UPDATE query has been
sent to Microsoft SQL Server 2014 Express.

The error seems to show up in
FireDAC.Phys.ODBCWrapper.FireDAC.Phys.ODBCWrapper.TODBCCommandStatemen
t.Execute :

Here, the variable iRet is of type SQLReturn

 iRet := Lib.SQLExecDirect(FHandle,
PSQLChar(AExecDirectCommand), SQL_NTS);


When iRet = 100, it means that the problem is SQL_NO_DATA, but I saw
that sometimes an value of 100 doesn't raise an error.

I can't step into the SQLExecDirect function to see what this
function do ... :S

What does 'no sql data' means ? Is my UPDATE query supposed to
return something ??

If it is a single statement NO_SQL_DATA means, that no records were
affected. HAve a look at the WHERE clause. Maybe another user changed
the record in the meanwhile?

If there are batched statements:

https://docs.microsoft.com/en-us/sql/odbc/reference/appendixes/returning
-sql-no-data

Good luck
Bernd

--

Maxime Bonin

Posts: 61
Registered: 1/23/17
Re: No idea how to solve : '[FireDAC][Phys][ODBC][sqlncli11.dll]SQL_NO_DATA' ?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 28, 2017 6:30 AM   in response to: Bernd Maierhofer in response to: Bernd Maierhofer
You've got it right Bernd !

The problem was in the WHERE section of the UPDATE query.

A value of one field was modified in the meantime, so no UPDATE was performed.

Bernd Maierhofer wrote:
Maxime Bonin wrote:

I use FireDAC with Microsoft SQL Server Express 2014

I get an '[FireDAC][Phys][ODBC][sqlncli11.dll] SQL_NO_DATA' error
when specific TDataSet in my code calls POST

SQL Profiler shows that it happens after an UPDATE query has been
sent to Microsoft SQL Server 2014 Express.

The error seems to show up in
FireDAC.Phys.ODBCWrapper.FireDAC.Phys.ODBCWrapper.TODBCCommandStatemen
t.Execute :

Here, the variable iRet is of type SQLReturn

 iRet := Lib.SQLExecDirect(FHandle,
PSQLChar(AExecDirectCommand), SQL_NTS);


When iRet = 100, it means that the problem is SQL_NO_DATA, but I saw
that sometimes an value of 100 doesn't raise an error.

I can't step into the SQLExecDirect function to see what this
function do ... :S

What does 'no sql data' means ? Is my UPDATE query supposed to
return something ??

If it is a single statement NO_SQL_DATA means, that no records were
affected. HAve a look at the WHERE clause. Maybe another user changed
the record in the meanwhile?

If there are batched statements:

https://docs.microsoft.com/en-us/sql/odbc/reference/appendixes/returning
-sql-no-data

Good luck
Bernd

--

Bernd Maierhofer

Posts: 161
Registered: 9/27/99
Re: No idea how to solve :'[FireDAC][Phys][ODBC][sqlncli11.dll]SQL_NO_DATA' ?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 2, 2017 1:18 AM   in response to: Maxime Bonin in response to: Maxime Bonin
:-)
It was a pleasure.

B.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02