Problem with SQL_LONGVARBINAY - Mailing list pgsql-odbc

From Han
Subject Problem with SQL_LONGVARBINAY
Date
Msg-id 20030317090032.3D0B7476105@postgresql.org
Whole thread Raw
List pgsql-odbc
Hi,
     There's a problem when insert a SQL_LONGVARBINARY(lo) column in the following way:
    Use SQLBindParameter(...SQL_DATA_AT_EXEC)
    and SQLParamData, SQLPutData.
    The last time SQLParamData revoke a crash!
    This is the sample code:
    for (...)
    {
        sdw = SQL_DATA_AT_EXEC;
        rc = SQLBindParameter(hstmt, w, SQL_PARAM_INPUT,
                SQL_C_TCHAR, rgFields[ind].wSQLType,
                rgFields[ind].precision, rgFields[ind].scale,
                (LPTSTR)(((UDWORD)ind)+BIND_PARM_OFFSET), 0, &sdw);
    }
    rc = SQLExecDirect(hstmt, lpqt->sz, SQL_NTS);
    if (SQL_NEED_DATA != rc)
        return;
    for(ind = 0; ind <= cTypes; ind++)
    {
        rc = SQLParamData(hstmt, &ptr);
        if(rc != SQL_NEED_DATA)
            break;

        pch = qtMakeData(...);

        if(*pch) {
            rc = SQLPutData(hstmt, pch, SQL_NTS);
        } else {
            rc = SQLPutData(hstmt, (LPTSTR)IGNORED, SQL_NULL_DATA);
        }
    }

    please check, thanks and regards!


        


        Han
        zhouhanok@vip.sina.com
          2003-03-17




pgsql-odbc by date:

Previous
From: Renê Salomão
Date:
Subject: Recipe for ODBC source
Next
From: Adrian Klaver
Date:
Subject: psqlODBC&unixODBC