What is the problem with this code?

Поиск
Список
Период
Сортировка
От Igor Korot
Тема What is the problem with this code?
Дата
Msg-id CA+FnnTyfwr3Q+=AWAN--w8DyQxEuyFkjtBoWxakDtMN=5kCS1A@mail.gmail.com
обсуждение исходный текст
Ответы Re: What is the problem with this code?  (Clemens Ladisch <clemens@ladisch.de>)
Список pgsql-odbc
Hi, ALL,

[code]
    std::wstring query1 = L"SHOW log_directory";
    std::wstring query2 = L"SHOW log_filename";
    SQLWCHAR *qry1 = new SQLWCHAR[query1.length() + 2];
    SQLWCHAR *qry2 = new SQLWCHAR[query2.length() + 2];
    memset( qry1, '\0', query1.length() + 2 );
    memset( qry2, '\0', query2.length() + 2 );
    uc_to_str_cpy( qry1, query1 );
    uc_to_str_cpy( qry2, query2 );
    RETCODE ret = SQLAllocHandle( SQL_HANDLE_STMT, m_hdbc, &m_hstmt );
    if( ret == SQL_SUCCESS || ret == SQL_SUCCESS_WITH_INFO )
    {
        ret = SQLPrepare( m_hstmt, qry1, 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;
            }
[/code]

The SQLDescribeCol() call fails with the error invalid column number".

Does anybody have any idea?

Thank you.


В списке pgsql-odbc по дате отправления:

Предыдущее
От: Védaste Barnier [Datavenir]
Дата:
Сообщение: TR: Request for quotation and partnership for ODBC Driver
Следующее
От: Clemens Ladisch
Дата:
Сообщение: Re: What is the problem with this code?