Re: Struggling with OCI :-<

From: Keith Majkut <kmajkut_at_netcom.com>
Date: 1996/01/17
Message-ID: <kmajkutDLAtoy.8p_at_netcom.com>#1/1


In article <30FBFEF7.584B_at_bearriver.com>, Allan Hoeltje <ahoeltje_at_bearriver.com> wrote:
>I am developing a Macintosh C++ app that uses the Oracle Call
>Interface to do simple INSERT and SELECT commands. The version I am
>using is Oracle 6. This is my first Oracle exposure but I have used
>other RDBMS systems in the past, notably Sybase, so I am not a total
>newbie.
>
>I have two major problems:
>
>1) the oermsg() function never returns a text message no matter
>which version of the error return code I give it. The documentation
>is unclear on what the first parameter is supposed to be, it might
>be the cursor data area csrrc variable, or it could be csrarc; the
>sample on page 19-26 of the ³Programmer¹s guide to the Oracle
>Interfaces² says crs_rc but that can¹t be correct because no such
>identifier exists. In addition to never returning a text message,
>oermsg also has the unique feature of sometimes causing a BUS error.
The first parameter to OERMSG should be csr->rc, meaning the return code, not a variable named crs_rc....

>
>2) After parsing, binding, and executing a SELECT statement I would
>like to know how many rows will be available for fetching. The
>documentation is vague but hints that csrrpc in the cursor data area
>(rows processed count) will contain the number of rows affected, but
>it is always 0 after the call to oexec. (I have noticed that csrrpc
>is incremented by 1 for each call to ofetch, not exactly a useful
>feature.)
The only way to tell the exact number of rows is to fetch them. You could execute a 2nd query and do a SELECT count(*) but that isn't guaranteed to work since rows could be inserted/deleted in between the time you did the first select count(*) and the real select.

>
>Any suggestions will be greatly appreciated.
>
>-Allan
Received on Wed Jan 17 1996 - 00:00:00 CET

Original text of this message