Subject | Re: What is the best way to find if THREE or more records exists |
---|---|
Author | kaczy27 |
Post date | 2004-11-18T11:33:38Z |
--- In firebird-support@yahoogroups.com, Svein Erling Tysvær
<svein.erling.tysvaer@k...> wrote:
I stepped into another solution (the easiest I believe),
stored_proc returning more_then smallint;
begin
for
select where ...
do begin
counter = counter + 1;
if counter > 3 then begin
more_than = 1;
suspend;
exit;
end
end
more_than = 0;
suspend;
end
straight query.
CUIN Kaczy
<svein.erling.tysvaer@k...> wrote:
>Unfortunately, I don't think EXECUTE IMMEDIATE is capable of
> doing a FOR SELECT with further processing (that would haveenabled
> you to write a stored procedure that took the number of records tothanks Set,
> check for as well as the table name as input parameters).
I stepped into another solution (the easiest I believe),
stored_proc returning more_then smallint;
begin
for
select where ...
do begin
counter = counter + 1;
if counter > 3 then begin
more_than = 1;
suspend;
exit;
end
end
more_than = 0;
suspend;
end
>Not sure about the stored proc execution time compared to the
> Set
straight query.
CUIN Kaczy