Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 6ACA563620E for ; Wed, 10 Mar 2010 11:11:35 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 43532-08 for ; Wed, 10 Mar 2010 15:11:24 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from kuber.nabble.com (kuber.nabble.com [216.139.236.158]) by mail.postgresql.org (Postfix) with ESMTP id 27D08632A15 for ; Wed, 10 Mar 2010 11:10:58 -0400 (AST) Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1NpNYm-0002Yd-R4 for pgsql-odbc@postgresql.org; Wed, 10 Mar 2010 07:10:56 -0800 Message-ID: <27851040.post@talk.nabble.com> Date: Wed, 10 Mar 2010 07:10:56 -0800 (PST) From: VitaliyG To: pgsql-odbc@postgresql.org Subject: Re: get number of rows selected In-Reply-To: <9103513CAFE9554496DD17054510B6DF01287EA1@corpappl002.corp.saab.se> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: vitaliygrabchuk@gmail.com References: <9103513CAFE9554496DD17054510B6DF01287EA1@corpappl002.corp.saab.se> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201003/7 X-Sequence-Number: 10213 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.