Home » Developer & Programmer » Precompilers, OCI & OCCI » Getting the number of rows return
Getting the number of rows return [message #113206] Thu, 31 March 2005 11:08 Go to next message
laplante
Messages: 3
Registered: March 2005
Junior Member
If I do a select * from EMP;

How do I get the number of rows return if I DON'T use
scrollable cursor.

Here is my execute:

OCIStmtExecute(pl -> svchp, pl -> stmthp, pl -> errhp, (ub4) 0, (ub4) 0,
               (CONST OCISnapshot *) NULL, (OCISnapshot *) NULL, OCI_DEFAULT)


Is there a way to know the number of rows return before doing the fetch?

In the same idea, is it possible to get the number or row affected after a delete or an update?

[Updated on: Thu, 31 March 2005 15:04]

Report message to a moderator

Re: Getting the number of rows return [message #118028 is a reply to message #113206] Mon, 02 May 2005 14:45 Go to previous messageGo to next message
Michael Hartley
Messages: 110
Registered: December 2004
Location: West Yorkshire, United Ki...
Senior Member

Hi,

try executing "select count(*) from emp", this will return the number of rows in the table at the point of execution. Don't forget in a multi-user environment the number of row's can change dynamically.

If you want to know how many row's were affected by a delete or update execution, you can get the attribute value for OCI_ATTR_ROW_COUNT from the statement handle immediately after the ocistmtexecute command has completed.

Kind regards,
Michael Hartley, http://www.openfieldsolutions.co.uk
Re: Getting the number of rows return [message #151838 is a reply to message #118028] Mon, 19 December 2005 07:00 Go to previous messageGo to next message
manav.sah
Messages: 15
Registered: September 2005
Location: India
Junior Member

hi!.....
can some one tell me how to create the scrollable resultset in the occi .......
i m trying to create to a database browser.... for oracle....
with navigation facility....
Re: Getting the number of rows return [message #206531 is a reply to message #118028] Thu, 30 November 2006 08:04 Go to previous message
arunpeswaran
Messages: 1
Registered: November 2006
Junior Member
Hi :

Could you please tell me what the OCIParamGet() call should look like when trying to retreive the OCI_ATTR_ROW_COUNT attribute.

I'm not sure what the values should be for the last two parameters in the OCIParamGet() call.

Thanks
Arun
Previous Topic: ODBC ResultSet problem
Next Topic: Abort while using Date (HPUX11.0)
Goto Forum:
  


Current Time: Tue Dec 03 22:05:48 CST 2024