The documentation here is the following code example for using cursor :
execute block returns ( relation char(31), sysflag int) as declare cur cursor for (select rdb$relation_name, rdb$system_flag from rdb$relations); begin open cur; while (1=1) do begin fetch cur into relation, sysflag; if (row_count = 0) then leave; suspend; end close cur; end
But it can also be done as follows:
execute block returns ( relation char(31), sysflag int) as begin for select rdb$relation_name, rdb$system_flag from rdb$relations into relation, sysflag do begin suspend; end end
So why would I like to use it? Ultimately, the above example does not even require an execlute block , as it is just a simple select statement. Therefore, I believe that this example is too simple to demonstrate the advantage of this.
Paul source share