select query returns no result

General
Enthusiast

select query returns no result

I met a problem when connected to the td server using its windows version odbc, tried version 16.00.01 and 14.10, both had no luck. I could use qt5's odbc driver to list the tables and the columns of a table, but I couldn't get anything from a query, even if I copied the sql of querying the tables and the columns from the trace log, truly disappointed. I could execute those sql in bteq successfully. Before the error is: SQL_NO_DATA_FOUND, and now it becomes: ------------------------------------------------------------------------------ 17321 1 TS:1201:[5948] STMT::Request returns SQL_SUCCESS [ dbccli2.cpp 9447 ] 17322 TS:1201:[5948] STMT::SetStmtState [ cstmt.cpp 1475 ] 17323 TS:1201:[5948] Setting S5 state. [ cstmt.cpp 1502 ] 17324 TS:1201:[5948] STMT::SetStmtState END [ cstmt.cpp 1722 ] 17325 1 TS:1201:[5948] SQLExecDirect returns SQL_SUCCESS [ execute.cpp 543 ] 17326 TS:1201:[5948] SQLGetStmtAttr(hStatementHandle 6) [ attrib.cpp 1814 ] 17327 TS:1216:[5948] ERROR LOGGED SUCCESSFULLY [ sqlerror.cpp 1198 ] 17328 TS:1216:[5948] [SetDiagStatusRec][HYC00][S1C00][1][[Teradata][ODBC Teradata Driver] Unsupported] [ sqlerror.cpp 1297 ] 17329 TS:1216:[5948] SQLNumResultCols(hstmt6, pccol) [ results.cpp 210 ] td server: TDExpress14.0.3 Suse 10 x64 client: Windows 7 x64 I didn't find a place to upload my log... Anyone has any advices, thank you in advance.
Tags (1)
2 REPLIES
Teradata Employee

Re: select query returns no result

Did you try setting the result set cursor to be "forward only"?

Enthusiast

Re: select query returns no result

(How to format the text, didn't find a guide for this.) I haven't set forward only, but there's something about this in the trace log: --------------------------------------------------------------------------------------------------- 17142 1 TS:951:[5948] STMT::UnBind [ cstmt.cpp 930 ] 17143 1 TS:951:[5948] STMT::ResetParams [ cstmt.cpp 902 ] 17144 TS:951:[5948] STMT::FreeDescriptors - Deleting 246CB0 [ cstmt.cpp 2109 ] 17145 TS:951:[5948] STMT::FreeDescriptors - Deleting 246DD0 [ cstmt.cpp 2116 ] 17146 TS:951:[5948] STMT::FreeDescriptors - Deleting 246EF0 [ cstmt.cpp 2123 ] 17147 TS:951:[5948] STMT::FreeDescriptors - Deleting 247010 [ cstmt.cpp 2130 ] 17148 TS:951:[5948] doing delete on CFromTeradataLanMessage [ ctlanmsg.cpp 853 ] 17149 TS:951:[5948] CToTeradataLanMessage::operator delete (p=0x28D0040) [ ctlanmsg.cpp 523 ] 17150 TS:951:[5948] STMT::FreeReadAheadBuffer - buffer is NULL [ cstmt.cpp 698 ] 17151 TS:967:[5948] Entering SQLAllocHandle [ connect.cpp 743 ] 17152 TS:967:[5948] SQLAllocHandle: SQL_HANDLE_STMT [ connect.cpp 759 ] 17153 TS:967:[5948] SQLAllocStmt(hdbc1, phstmt4EB738) [ connect.cpp 654 ] 17154 1 TS:967:[5948] ...STMT constructed - 0x29F260 [ cstmt.cpp 282 ] 17155 1 TS:967:[5948] STMT::SetReadAheadFromDSN - Read-ahead is enabled. Buffer state set to 1 [ dbccli2.cpp 2352 ] 17156 TS:967:[5948] STMT::AllocateMessageBuffers(insize=65536, outsize=1048576) [ cstmt.cpp 585 ] 17157 TS:967:[5948] CFromTeradataLanMessage::operator new(size=344, actualSize=66100) p=0x28AE90 [ ctlanmsg.cpp 843 ] 17158 TS:967:[5948] CToTeradataLanMessage::operator new (Size=8252, ActualSize=1048628) p=0x28D0040 [ ctlanmsg.cpp 514 ] 17159 TS:967:[5948] SQLGetStmtAttr(hStatementHandle 6) [ attrib.cpp 1814 ] 17160 TS:967:[5948] SQL_ATTR_APP_ROW_DESC, 22 [ attrib.cpp 1973 ] 17161 TS:967:[5948] SQLGetStmtAttr(hStatementHandle 6) [ attrib.cpp 1814 ] 17162 TS:967:[5948] SQL_ATTR_APP_PARAM_DESC, 21 [ attrib.cpp 1963 ] 17163 TS:967:[5948] SQLGetStmtAttr(hStatementHandle 6) [ attrib.cpp 1814 ] 17164 TS:967:[5948] SQL_ATTR_IMP_ROW_DESC, 24 [ attrib.cpp 1991 ] 17165 TS:967:[5948] SQLGetStmtAttr(hStatementHandle 6) [ attrib.cpp 1814 ] 17166 TS:967:[5948] SQL_ATTR_IMP_PARAM_DESC, 23 [ attrib.cpp 1982 ] 17167 TS:967:[5948] SQLSetStmtAttr(hstmt 6) [ attrib.cpp 1052 ] 17168 TS:967:[5948] ...) [ attrib.cpp 1068 ] 17169 TS:967:[5948] SetStmtAttr(hdbc I64x, hstmt I64x, [ attrib.cpp 2277 ] 17170 TS:967:[5948] SQL_ATTR_CURSOR_TYPE, 3 [ attrib.cpp 2481 ] 17171 TS:982:[5948] ERROR LOGGED SUCCESSFULLY [ sqlerror.cpp 1198 ] 17172 TS:982:[5948] [SetDiagStatusRec][01S02][01S02][1][[Teradata][ODBC Teradata Driver] Only SQL_CURSOR_FORWARD_ONLY accepted at this time.] [ sqlerror.cpp 1297 ] 17173 1 TS:982:[5948] SQLExecDirect(hstmt=0x6, SqlStr=0x23AE50, cb=28) [ execute.cpp 277 ] 17174 1 TS:982:[5948] STMT::FreeResultSet() [ localres.cpp 211 ] 17175 1 TS:982:[5948] STMT::FreeResultSet() [ localres.cpp 211 ] 17176 1 TS:982:[5948] ... szSqlStr= [ execute.cpp 399 ] 17177 1 TS:982:[5948] select id from vmunic.person 17178 1 TS:982:[5948] 17179 1 TS:982:[5948] STMT::BmodePrepare [ dbccli2.cpp 9851 ] 17180 1 TS:982:[5948] ...STMT::SetbIsCursorOpen [ cstmt.cpp 1874 ] 17181 TS:982:[5948] Setting bIsCursorOpen. [ cstmt.cpp 1880 ] 17182 1 TS:982:[5948] STMT::BmodePrepare returns SQL_SUCCESS [ dbccli2.cpp 9880 ] 17183 1 TS:982:[5948] STMT::ExecDirect [ dbccli2.cpp 11332 ] 17184 TS:982:[5948] Updated STMT::req_id from MsgIn->GetRequestNo(), req_id = 20 [ dbccli2.cpp 11407 ] 17185 1 TS:982:[5948] ...STMT::ExecDirect using 'B' mode [ dbccli2.cpp 11539 ] 17186 1 TS:982:[5948] STMT::NewRequestMessage [ dbccli2.cpp 1529 ] 17187 1 TS:982:[5948] STMT::NewOptionsMessage ('B') [ dbccli2.cpp 1442 ] 17188 TS:982:[5948] Updated MsgOut from lpdbc->ProduceNextRequestNo(), RequestNo = 21 [ dbccli2.cpp 1455 ]