Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

get number of rows selected


  • From: "Malm Paul" <paul(dot)malm(at)saabgroup(dot)com>
  • To: <pgsql-odbc(at)postgresql(dot)org>
  • Subject: get number of rows selected
  • Date: Thu, 3 Apr 2008 15:20:04 +0200
  • Message-id: <9103513CAFE9554496DD17054510B6DF01287EA1(at)corpappl002(dot)corp(dot)saab(dot)se>

Title: get number of rows selected

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



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group