get number of rows selected - Mailing list pgsql-odbc

From Malm Paul
Subject get number of rows selected
Date
Msg-id 9103513CAFE9554496DD17054510B6DF01287EA1@corpappl002.corp.saab.se
Whole thread Raw
Responses Re: get number of rows selected  ("Adam M" <gnuman1@gmail.com>)
Re: get number of rows selected  (VitaliyG <vitaliygrabchuk@gmail.com>)
List pgsql-odbc

Hi,
I dont know much about databases, and I have a question

I've just installed PostgreSLQ.
Now I would like to get the number of rows selected via a ODBC SQL statement in C++. I would like to know the amount before I do Fetch.

 
This is a little example of what I do in c++:

        selStr="select * from layer where visible = 1");
        rc = SQLAllocHandle(SQL_HANDLE_STMT, ConHandle, &StmtHandle);
        if(rc == SQL_SUCCESS)
        {
                SQLSetStmtOption(StmtHandle, SQL_CONCURRENCY, SQL_CONCUR_READ_ONLY);
                SQLSetStmtOption(StmtHandle, SQL_CURSOR_TYPE, SQL_CURSOR_KEYSET_DRIVEN);
                SQLSetStmtOption(StmtHandle, SQL_ROWSET_SIZE, m_rows);
                rc = SQLExecDirect(StmtHandle, (SQLCHAR *)selStr, SQL_NTS);
...
...
...
How do I know how many rows that was found??

Kind regards,

Paul Malm

pgsql-odbc by date:

Previous
From:
Date:
Subject: [ psqlodbc-Bugs-1010368 ] connection problem with postgresql driver 8.03.0100 to postgresql 8.3.0
Next
From: "Nguyen, Lam Thuy"
Date:
Subject: Connection of postgres