Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> How to get count using OCI?

How to get count using OCI?

From: Tee Parham <tparham_at___qmsoft.com>
Date: Tue, 13 Jul 1999 12:18:49 -0600
Message-ID: <378B8309.32CC1BFD@__qmsoft.com>


I am using OCI 7 on a 7.3.4 server. I can't figure out the best way to simply get a count of the number of rows in a table-- all I want to do is duplicate the "select count(*) from table_x" sql string.

What I am currently doing looks like this:

  1. Parse the SQL statement "select count(*) from table_x"
  2. Define an output variable by position (1). I have tried numeric, float, & character.
  3. Execute
  4. Fetch 1 row

All of this works without an error, but the output variable I have defined does not contain the correct data-- it looks like the first 4 bytes are '' and the rest contain junk. It looks like the rpc of the cursor is 1, so I would think the fetch worked.

What data type should I use for the define variable? Any other ideas?

-tee

<<<remove the underscores (_) to reply to my email address>>> Received on Tue Jul 13 1999 - 13:18:49 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US