Re: Pro*C cursor matter...

From: Andrew Finkenstadt <andy_at_vistachrome.com>
Date: Mon, 23 Aug 1993 10:02:57 GMT
Message-ID: <CC7IKx.FrC_at_vistachrome.com>


h9112654_at_hkusub (Edward P.C. Yuen) writes:
> I'm currently writing a database application in Pro*C 1.3 for PC,
>and using the dynamic method 3 to query a database in a Sun machine. I am
>wondering is it possible to eliminate the use of a cursor, 'cos I know
>whenever I query the database, there is only 1 or 0 row returns.

Yes, quite easily.

EXEC SQL SELECT COUNT(0) INTO :myvar FROM MYTABLE WHERE CONDITIONS;

Now myvar will be equal to exactly 0 or however many would have been returned. This is an easy way to get around the No_Data_Found errors in FORMS 3.0 as well.

Andy

> Any useful suggestions can be forwarded to : h9112654_at_hkusub.hku.hk
> Thanx in advance.
>Happy Pro*Cing,
>--Edward Yuen
> University of Hong Kon

-- 
Andrew Finkenstadt  |  andy_at_{homes.com,vistachrome.com,genie.geis.com}
Systems Analyst     |  Vista-Chrome, Homes & Land Publishing Corporation
                    |  1600 Capital Circle SW, Tallahassee Florida 32310
+1 904-575-0189     |  GEnie Postmaster, Unix & Internet RoundTables Sysop
Received on Mon Aug 23 1993 - 12:02:57 CEST

Original text of this message