Re: Strange behavioral in Pro C

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Wed, 27 Oct 1999 11:25:13 -0400
Message-ID: <IBkXOEzczgB7dl7YG3=c5cKdY6h9_at_4ax.com>


A copy of this was sent to abutarif_at_my-deja.com (if that email address didn't require changing) On Wed, 27 Oct 1999 15:04:35 GMT, you wrote:

>Hi,
>I have the following problem with Pro C
>When I execute
>
>a) select field into :hostvariable where condition;
>
>the sqlca.sqlcode is > 0 which indicates a data not found error.
>If I put 'whenever not found do somthing()' statement, it is called
>after the statement in (a).
>However, if I execute:
>b) select count(*) into :count where condition;
>where the conditions in a and b are the same, I get a result.
>

aggregate queries that have no group by ALWAYS return a single row.

select count(*) from t where 1=0

returns 1 record = 0. Always (as would max, min, avg, etc)

>Even stranger, if I neglect the not found error and display the datea in
>the hostvariable after executing a I get the correect data.
>

not strange -- there is no error.

>This is the first time this happens to me although I've been using ProC
>for about a year now and I have in the same source code file other
>functions that does similar things and they are working perfectly.
>
>Does anyone know what's wrong?
>
>Thanks
>Asad
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.

-- 
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'...
Current article is "Part I of V, Autonomous Transactions" updated June 21'st
 
Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation
Received on Wed Oct 27 1999 - 17:25:13 CEST

Original text of this message