dbTalk Databases Forums  

CLI0165E

comp.databases.ibm-db2 comp.databases.ibm-db2


Discuss CLI0165E in the comp.databases.ibm-db2 forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Greig
 
Posts: n/a

Default CLI0165E - 01-27-2012 , 03:46 PM






I'm using SPSS to query a DB2 database and I get this error:

SQLFetch (getting tables) failed :[IBM][CLI Driver] CLI0165E Error in
row. SQLSTATE=01S01

The weird thing is that it looks like I'm getting all the data that I
should be and that the query worked fine. I'm not quite sure why I'd
get this error if there were really nothing wrong.

The explanation I've found for this error is this:
An error occurred while fetching one or more rows. (Function returns
SQL_SUCCESS_WITH_INFO.)

Not very helpful. Can anyone help me figure out the possible causes
for this?

Thanks,
Greig

Reply With Quote
  #2  
Old   
Greig
 
Posts: n/a

Default Re: CLI0165E - 01-27-2012 , 04:06 PM






On Jan 27, 4:46*pm, Greig <frital... (AT) gmail (DOT) com> wrote:
Quote:
I'm using SPSS to query a DB2 database and I get this error:

SQLFetch (getting tables) failed :[IBM][CLI Driver] CLI0165E *Error in
row. SQLSTATE=01S01

The weird thing is that it looks like I'm getting all the data that I
should be and that the query worked fine. *I'm not quite sure why I'd
get this error if there were really nothing wrong.

The explanation I've found for this error is this:
An error occurred while fetching one or more rows. (Function returns
SQL_SUCCESS_WITH_INFO.)

Not very helpful. *Can anyone help me figure out the possible causes
for this?

Thanks,
Greig
Nevermind. I just figured out that SPSS apparently throws that error
if a NULL value is returned. I would have never expected that. Seems
kinda silly actually. Oh well, at least I know now.

Reply With Quote
  #3  
Old   
Helmut Tessarek
 
Posts: n/a

Default Re: CLI0165E - 01-27-2012 , 04:21 PM



In this case this is a bug in SPSS. The DB2 CLI call is apparently missing the
pointer to the variable in the function call.

SQLRETURN SQLBindCol (
SQLHSTMT StatementHandle, /* hstmt */
SQLUSMALLINT ColumnNumber, /* icol */
SQLSMALLINT TargetType, /* fCType */
SQLPOINTER TargetValuePtr, /* rgbValue */
SQLLEN BufferLength, /* dbValueMax */
SQLLEN *StrLen_or_IndPtr); /* *pcbValue */

I assume that in the SPSS code, the call looks like this:
cliRC = SQLBindCol(hstmt, 1, SQL_C_SHORT, &deptnumb.val, 0, NULL);
instead of:
cliRC = SQLBindCol(hstmt, 1, SQL_C_SHORT, &deptnumb.val, 0, &deptnumb.ind);

Explanation:
The variable that the StrLen_or_IndPtr argument refers to is used for both
indicator and length information. If a fetch encounters a null value for the
column, it stores SQL_NULL_DATA in this variable; otherwise, it stores the
data length in this variable. Passing a null pointer as StrLen_or_IndPtr keeps
the fetch operation from returning the data length, but makes the fetch fail
if it encounters a null value and has no way to return SQL_NULL_DATA.

On 27.01.12 17:06 , Greig wrote:
Quote:
Nevermind. I just figured out that SPSS apparently throws that error
if a NULL value is returned. I would have never expected that. Seems
kinda silly actually. Oh well, at least I know now.

--
Helmut K. C. Tessarek
DB2 Performance and Development
IBM Toronto Lab

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.