Re: Pro*C - is using sqlerrd[2] bad practice
From: Pierre Charpenay <pcharpenay_at_unilog.fr>
Date: 2000/06/09
Message-ID: <3940D540.C8B6811C_at_unilog.fr>#1/1
Date: 2000/06/09
Message-ID: <3940D540.C8B6811C_at_unilog.fr>#1/1
Hello everybody !
Unfortunately, it seems you can't use anything else but
sqlca.sqlerrd[2].
In order to solve your problem, I suggest you to use #define.
For example, if you add this line in the sqlca.h file (or another at the
same place) :
#define SQL_ROWCOUNT sqlca.sqlerrd[2]
You can then use SQL_ROWCOUNT everywhere in your sources. If Oracle changes its implementation, you have just to change your add-on and recompile.
Hope this helps.
Bye
-- Pierre CHARPENAY Obakesan wrote :Received on Fri Jun 09 2000 - 00:00:00 CEST
>
> HiYa
>
> I'm currently using sqlerrd[2] to determine the amount of rows that have
> been returned in a cursor , however I don't like hard coding values into
> C programs, and this is doing just that.
>
> I am worried that I'm making a maintainence issue for the future should
> Oracle change how this is implimented ... I know in PL/SQL that I'd use
> cur%ROWCOUNT to access this value, is there something that I've missed
> here to have something more abstract?
>
> thanks
>
> --
>
> See Ya
> (when the bandwidth gets better ;-)
> Chris Eastwood Please remove undies for reply
> Photographer, Stunt Programmer
> Motorcyclist and dingbat