Subject Re: [ib-support] Is there any way to get the record count from the for select or select statements??
Author Helen Borrie
At 05:30 PM 08-01-02 +0200, you wrote:
>Hi all
>
> Is there any way to get the record count from the for select or select
>statements at sp/triger codes like rows affected?
>
>for example
> FOR SELECT DOVKOD
> FROM DOVKART
> WHERE DOVKOD <> :DEFCUR AND TAKIP = 1
> INTO :DOVKODU
>do begin
> bla
> bla
> bla
>end
>
>how can I know the number of record I'll retreive or 'bla' on.
>Please somethin better than first count( fieldname) then do sth.

create procedure blah (DEFCUR some_type)
returns (rowcount integer)
as
rowcount = 0;
...
FOR SELECT DOVKOD
FROM DOVKART
WHERE DOVKOD <> :DEFCUR AND TAKIP = 1
INTO :DOVKODU
do
begin
bla
bla
bla
rowcount = :rowcount + 1;
end
...
end

regards,
Helen


All for Open and Open for All
Firebird Open SQL Database ยท http://firebirdsql.org
_______________________________________________________