RE: Does a given row exist.
Posted in 2004
Andrew Hardy wrote
> I want to check whether a row for a given critera exists.
>
> the only way I know at present is, for example:
>
> SELECT f1, f2 FROM t WHERE f3 = 'something' And ... ... ; if
> (SQLCODE == 0) { ...> }
>
> if (SQLCODE == 100)
> {
> ...
> }
>
> I am wondering if there is a more efficient way which avoids
> unnecessarily retrieving fields f1 and f2.
I am not quite sure what you are trying to do, but would -
Select count(*) norecs FROM t WHERE f3 = 'something' And ... ... ; if
if (norecs == 100)
Be any more use..
Colin Bull
_______________________________________________________________________
This email has been scanned for all known viruses by the MessageLabs Email
Security System.
_______________________________________________________________________
sending to informix-list