I think the trick is to use SELECT COUNT(*) INTO :hostvar, so that you can
control where the result of the count function is placed. I haven't done
this with RXSQL, but SQL is (pretty much) SQL, so it would look something like:
"select count (*) into :mycount",
"from car_table",
"where color='RED' AND model = 'MUSTANG'""
say 'There are' mycount 'RED MUSTANGS found in table CAR_TABLE'
At 03:26 PM 7/7/00 -0400, Daryl Wells wrote:
>I am trying to use COUNT in a SQL SELECT statement using RXSQL (against
>DB2) in a REXX exec. But, I do not know where the result (number of rows)
>is located. Can anyone help? Instead of using the COUNT, I could use
>EXECIO and read in the data to get the number of rows after selecting.
>But, I would prefer to use COUNT.
>
>Thank you in advance for any help.
>
>------------------------------------------------------------------
>From: Daryl Wells
> DB/DC Support
> IBM Global Services
> Tie Line 427-7487
> Phone (813) 801-7487
> Pager (800) 759-8888 pin 1366198 or
>http://www.skytel.com/Paging/index.html
Regards,
Bob Stark [ProTech - When you're serious about Systems Management]
www.protechpts.com 800-373-9188 x150