Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to get count using OCI?
What are you actually passing for the type when you do the define? You
say you tried numeric, float and character, but what you mean by that.
You need to pass OCI the external type you, not the Oracle native type,
& OCI will do the appopriate conversion.
In article <378B8309.32CC1BFD@__qmsoft.com>,
Tee Parham <tparham@__qmsoft.com> wrote:
> 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>>>
>
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Received on Wed Jul 14 1999 - 11:18:09 CDT
![]() |
![]() |