Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Oracle 8 and ODBC truncation problems
I have a C++ ODBC program which replicates a (Versant) database into
an Access database for reporting purposes. The program should also
work with an other ODBC database, so I've been testing it with Oracle
8 on NT. I'm having trouble with SQLBindParameter when the SQLExecute
is inside a loop. Oracle (or the drivers?) seems to be ignoring the
final parameter which is SQL_NTS. Instead of copying the whole
string, it only copies part of it. If I redo the SQLBindParameter
call, it works - but I don't think I should have to do that.
This code only works the first time. Subsequent groupNames are truncated to the length of th first groupName. cbgroup=SQL_NTS;
SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR,(GROUPNAME_LEN),0, groupName, 0, &cbgroup);
while (++GroupData) {
groupName = GroupData().GroupName(); rc = SQLExecute(hstmt);
This code works every time.
cbgroup=SQL_NTS;
while (++GroupData) {
groupName = GroupData().GroupName(); SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR,(GROUPNAME_LEN),0, groupName, 0, &cbgroup);
rc = SQLExecute(hstmt);
}
Any ideas would be appreciated.
Mira Lieberman
mira_at_primus.com
Received on Tue Dec 15 1998 - 18:01:05 CST