[unixODBC-support] unixODBC problem in HP-UX IA64

手嶋 和徹 kazuaki.teshima.px at bp.renesas.com
Thu Nov 14 10:01:10 GMT 2013


Hi

My name is kazu teshima.

I'm now  tring to convert IBM/CLI(64bit) C++ Program to HPUX/unixODBC(64bit) C++ with odbcUNIX Driver(2.3.0).
※try to connect to Oracle 11g

but,some case when Reply have more 2 records,then unixODBC Fetch stoped.

Promgram is simple.

Class Define:
class test{
SQLCHAR  xxx[10],
SQLCHAR  yyy[15]
}

Program
HPUX aCC
・PrepareSel
    rowsize = (SQLLEN)sizeof(class test)
    SQLSetStmtAttr(hstmt, SQL_ATTR_ROW_BIND_TYPE, (SQLPOINTER) rowsize, NULL);
    SQLSetStmtAttr(hstmt, SQL_ATTR_ROW_ARRAY_SIZE, (SQLPOINTER) &rows, NULL);
    SQLPrepare(hstmt, (SQLCHAR*) getSqlstmt().c_str(), SQL_NTS);
・open
  SQLExecute(hstmt);
・fetch
  SQLFetch(hstmt);  ⇒Stopped.

when this case ,I thought rowsize = 27(length of [xxx]+"\0"+length[+yyy]+"\0") is correct,but this rowsize
causes Fetch stopped. and the other rowsize ( For example rowsize = 51) is passed.

I'd like to know the following.

1. why rowsize = 51 is correct?what's the logic of calculate rowsize?
2. Please tell me the url in this case source.
  SQLSetStmtAttr/SQLExecute/SQLFetch

best regards.

Thank you.



More information about the unixODBC-support mailing list