Why this code fails
От | Igor Korot |
---|---|
Тема | Why this code fails |
Дата | |
Msg-id | CA+FnnTxF3rCGsBr7i5qCP5W1F8QyOajG0h2dJ5h-9iusdLMz6g@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: Why this code fails
|
Список | pgsql-odbc |
Hi, Following code fails with the error "Invalid column nuber in DescribeCol". I'm trying to run it with the iODBC DM and the official PG ODBC driver. [code] int ODBCDatabase::AskPostgresForLogFile() { int result = 0; SQLWCHAR *columnName = new SQLWCHAR[256], *columnData; SQLSMALLINT columnNameLen, columnDataType, columnDataDigits, columnDataNullable; SQLLEN columnDataLen; SQLULEN columnDataSize; std::wstring query = L"SHOW log_directory"; std::vector<std::wstring> errorMsg; SQLWCHAR *qry = new SQLWCHAR[query.length() + 2]; memset( qry, '\0', query.length() + 2 ); uc_to_str_cpy( qry, query ); RETCODE ret = SQLAllocHandle( SQL_HANDLE_STMT, m_hdbc, &m_hstmt ); if( ret == SQL_SUCCESS || ret == SQL_SUCCESS_WITH_INFO ) { ret = SQLPrepare( m_hstmt, qry, SQL_NTS ); if( ret != SQL_SUCCESS && ret != SQL_SUCCESS_WITH_INFO ) { GetErrorMessage( errorMsg, 1 ); result = 1; } else { ret = SQLDescribeCol( m_hstmt, 1, columnName, 256, &columnNameLen, &columnDataType, &columnDataSize, &columnDataDigits, &columnDataNullable ); if( ret != SQL_SUCCESS && ret != SQL_SUCCESS_WITH_INFO ) { GetErrorMessage( errorMsg, 1 ); result = 1; } else { } } [/code] Thank you.
В списке pgsql-odbc по дате отправления: