pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: VitaliyG <vitaliygrabchuk@gmail.com>
To: pgsql-odbc@postgresql.org
Subject: Re: get number of rows selected
Date: Wed, 10 Mar 2010 07:10:56 -0800 (PST)
Message-ID: <27851040.post@talk.nabble.com> (raw)
In-Reply-To: <9103513CAFE9554496DD17054510B6DF01287EA1@corpappl002.corp.saab.se>
References: <9103513CAFE9554496DD17054510B6DF01287EA1@corpappl002.corp.saab.se>




paul malm wrote:
> 
> 
> 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
> 
> 
> 

Use SQLRowCount ODBC function

-- 
View this message in context: http://old.nabble.com/get-number-of-rows-selected-tp16475169p27851040.html
Sent from the PostgreSQL - odbc mailing list archive at Nabble.com.




view thread (4+ messages)

Message-ID: <27851040.post@talk.nabble.com>
Permalink:  ../27851040.post@talk.nabble.com/
Also on:    postgresql.org/message-id/27851040.post@talk.nabble.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: vitaliygrabchuk@gmail.com
  Subject: Re: get number of rows selected
  In-Reply-To: <27851040.post@talk.nabble.com>
  References: <9103513CAFE9554496DD17054510B6DF01287EA1@corpappl002.corp.saab.se> <27851040.post@talk.nabble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox