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

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: 2008-04-03 13:20:04
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-odbc
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,
		SQLSetStmtOption(StmtHandle, SQL_CURSOR_TYPE,
		SQLSetStmtOption(StmtHandle, SQL_ROWSET_SIZE, m_rows);
		rc = SQLExecDirect(StmtHandle, (SQLCHAR *)selStr,
How do I know how many rows that was found??

Kind regards,

Paul Malm


pgsql-odbc by date

Next:From: Nguyen, Lam ThuyDate: 2008-04-03 14:04:05
Subject: Connection of postgres
Previous:From: noreplyDate: 2008-04-02 10:21:34
Subject: [ psqlodbc-Bugs-1010368 ] connection problem with postgresql driver 8.03.0100 to postgresql 8.3.0

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group