Subject | Re: Dynamic SELECT FIRST? |
---|---|
Author | Luis Semedo Duarte |
Post date | 2009-05-19T09:11:06Z |
Thanks for you suggestions.
Here his an example:
create procedure select_first (
records integer)
returns (
dummy char(31)
)
as
begin
for
select first :records
rr.rdb$relation_name
from
rdb$relations rr
into
:dummy
do
begin
suspend;
end
end
When trying to compile the sp a parsing error is returned! (Im using
Firbird 2.0)
This is the code that i am actually using to produce the same effect:
create procedure select_first (
records integer)
returns (
dummy char(31)
)
as
declare variable counter integer;
begin
counter = 1;
for
select
rr.rdb$relation_name
from
rdb$relations rr
into
:dummy
do
begin
suspend;
if (counter < records) then counter = counter + 1;
else break;
end
end
Am i doing this right? Or is there another/better way to do the same
thing?
Thank's all in advance!
Luis Semedo Duarte
[Non-text portions of this message have been removed]
Here his an example:
create procedure select_first (
records integer)
returns (
dummy char(31)
)
as
begin
for
select first :records
rr.rdb$relation_name
from
rdb$relations rr
into
:dummy
do
begin
suspend;
end
end
When trying to compile the sp a parsing error is returned! (Im using
Firbird 2.0)
This is the code that i am actually using to produce the same effect:
create procedure select_first (
records integer)
returns (
dummy char(31)
)
as
declare variable counter integer;
begin
counter = 1;
for
select
rr.rdb$relation_name
from
rdb$relations rr
into
:dummy
do
begin
suspend;
if (counter < records) then counter = counter + 1;
else break;
end
end
Am i doing this right? Or is there another/better way to do the same
thing?
Thank's all in advance!
Luis Semedo Duarte
[Non-text portions of this message have been removed]